Senior Software Development Engineer Interview Questions
- 0of 0 votes
AnswersFind out if there is cycle in Directed graph
- pc April 09, 2016 in United States| Report Duplicate | Flag | PURGE
Microsoft Senior Software Development Engineer Algorithm Data Structures - -1of 1 vote
AnswersGiven billions of Rectangle, find rectangle with minimum area overlapping to a given point P(x,y)
- pc April 09, 2016 in United States
There is a simple way to achieve answer in O(n) by processing each rectangle sequentially, but optimize it further provided large number of Rectangle array.| Report Duplicate | Flag | PURGE
Microsoft Senior Software Development Engineer Algorithm Data Structures - 35of 35 votes
AnswersWrite a code to reverse the words in a sentence.
- Rajesh Burla March 11, 2016 in India| Report Duplicate | Flag | PURGE
Capgemini Senior Software Development Engineer - 1of 1 vote
Answerswhat is the best sorting algorithm in terms of complexity and why?
- Rajesh Burla March 11, 2016 in India| Report Duplicate | Flag | PURGE
Microsoft Senior Software Development Engineer Algorithm - 0of 0 votes
AnswerWhat is the best way to merge unsorted list and generate a single sorted list ?
- shin.subash March 10, 2016 in United States
I was giving an option of inserting into Binary tree from both list and retrieve it.what is the best solution| Report Duplicate | Flag | PURGE
Digital Insight Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersTHERE ARE SEVERAL LOG FILES COMING BY DATE WITH PRODUCT IDS AND I NEED TO REPORT THE TOP 10 (PRODUCT IDS) DURING A MOVING PERIOD OF 1 MONTH. DISCUSSED ABOUT THE DATA STRUCTURES NEEDED TO IMPLEMENT THE SOLUTION.
- bhardwaj.cs February 23, 2016 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersSSUME YOU HAVE A LARGE FILE WITH LINES OF TIMESTAMPS AND IP ADDRESSES . TIMESTAMPS ARE ORDERED, BUT MAY REPEAT AND MAY SKIP. HOW DO YOU DETERMINE WHETHER
- bhardwaj.cs February 23, 2016 in United States
THERE IS A TIME WINDOW THAT HAS A CERTAIN IP ADDRESS APPEARING MORE THAN K TIMES? HOW WOULD YOU SOLVE THIS IF INSTEAD YOU RECEIVED A STREAM.| Report Duplicate | Flag | PURGE
Bloomberg LP Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersGiven a stream of numbers write a program that computes sum of pair of numbers. There should be two methods store and IsNumberPresent. The store should store the numbers and IsNumberPresent should check if the number is present in the computed sums.
- anonymous February 16, 2016 in India| Report Duplicate | Flag | PURGE
Linkedin Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersDesign a class in such way that all the objects created have the same state(synced).
- Rajarathinam Antony December 29, 2015 in India
(i.e)For example,
We have a TextBox class, and instantiated in 3 places. when the user types any text in any of the
textboxes other textboxes also should reflect the same text.| Report Duplicate | Flag | PURGE
Capgemini Senior Software Development Engineer - 1of 1 vote
AnswersAssume that const_cast is not in place for C++, can you please write the code to do such casting?
- johnsvakel December 14, 2015 in India for MTS| Report Duplicate | Flag | PURGE
Symantec Senior Software Development Engineer C++ - 2of 4 votes
AnswersWe have a long string. We label some substrings with tags.
- Bill December 10, 2015 in United States
- A tag entry is [startIndex, endIndex, tag].
- Query: 1 or more tags
- Output: all blocks/ranges with all queried tags.
Example tag entries:
[23, 72, 0] // label [23, 72) with tag 0
[34, 53, 1] // label [34, 53) with tag 1
[100, 128, 0]
Query and Output:
0 => [23, 72], [100, 128]
0,1 => [34,53] // [34, 53) matches both tag 0 and 1
Give an efficient algorithm. Please describe your algorithm before posting code.
**Edit**: To add some difficulties, partial overlap is treated the same as full overlap, ONLY the overlapped part matches both tags. E.g. if we have entries:
[23, 72, 0] // label [23, 72) with tag 0
[10, 53, 1] // label [34, 53) with tag 1
Query and Output:
0,1 => [23,53] // [23, 53) matches both tag 0 and 1
Minor detials: Note in the comments we used open range on the right, i.e. if the string named "str", [23, 72, 0] includes str[23] but NOT str[72]; and there's no overlap between the following entries:
[23, 72, 0]
[10, 23, 0]| Report Duplicate | Flag | PURGE
Google Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersWe have a file path as like this:
- johnsvakel December 07, 2015 in India for DS
wchar_t* pCompletePath = L"\\?\UNC\10.1.3.23\TOKEN$\0x464564564576\C\FileDrive\Testcase.doc";
Write a C++ function which will take input argument as above string and gives output as L”\\?\UNC\10.1.3.23\TOKEN$\C\FileDrive\Testcase.doc” (Removing one token after the TOKEN$)
Constraints: TOKEN$ will be there for all strings, so we can use that for search| Report Duplicate | Flag | PURGE
Symantec Senior Software Development Engineer Arrays - 0of 0 votes
AnswersA file is given which consists of 3 columns : date, city and temperature. For ex:
- Priyanka December 01, 2015 in India
Date City Temperature
09-11-2015 Delhi 45
09-11-2015 Bangalore 24
09-11-2015 Ranchi 28
and it should support following type of queries:
1) What is the temperature of Bangalore on 9th November?
2) Give 5 hottest/coldest cities name on 9th November
You can preprocess the data and keep it in way that above query can be done in minimal time.
Which data structure will you use and how will you store the data?| Report Duplicate | Flag | PURGE
Snapdeal Senior Software Development Engineer Network - 1of 1 vote
AnswersInput argument of a method is a list of char array. The method have to print all the possible combination of input char(s)...For example if the input argument has ['A','B','C','D'] the output should be A,B,C,AB,AC,AD,BC,BD,CD,ABC,ACD,BCD,ABCD
- kumar October 19, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer Algorithm - 2of 2 votes
AnswersEvaluate the value of an expression given in Reverse Polish notation
- varun.venu September 22, 2015 in United States| Report Duplicate | Flag | PURGE
Linkedin Senior Software Development Engineer Coding - 4of 4 votes
AnswersThis question was asked in the Technical Design round.
- varun.venu September 22, 2015 in United States
How would you design a system to provide the top trending topcis in the last 5m/1hour/24hours
The most trending topic should appear first
A topic is said to be trending if it is shared the most. We are talking about a typical multi user environment (something like twitter, facebook).| Report Duplicate | Flag | PURGE
Linkedin Senior Software Development Engineer System Design - 1of 1 vote
AnswersThis question was asked in the first coding round on-site.
- varun.venu September 22, 2015 in United States
Give two sorted lists List<Integer> a and List<Integer> b.
Find
the Union of these two lists -> the union list should also be sorted
the Intersection of these two lists -> Intersection list should also be sorted.| Report Duplicate | Flag | PURGE
Linkedin Senior Software Development Engineer Coding - 1of 1 vote
AnswersThose who've attended on-site interview with LinkedIn might know that there are 2 rounds of coding interviews. This question was asked in my 2nd round of coding interview,
- varun.venu September 22, 2015 in United States
Given two valid dictionary words of same length, write a function which returns the minimum number of steps to go from the first to the second word.
You can change only one character at a time. Also, the word formed at every step should be a valid dictionary word.
Eg: Provide minimum steps to go from 'cat' to 'dog'
cat -> bat -> bet -> bot -> bog -> dog
Ans: 5| Report Duplicate | Flag | PURGE
Linkedin Senior Software Development Engineer Coding - 2of 4 votes
AnswersGiven two arrays were digits of one array represent a number,maxmise the number by replacing it with elements of second array.
- ritwik_pandey September 17, 2015 in United States
eg:
arr={3,1,4,5,6}
rep={1,9,5,2,3}
after replacement
arr={9,5,4,5,6}
one digit of rep can be used to replace only once.| Report Duplicate | Flag | PURGE
Microsoft Senior Software Development Engineer - 2of 2 votes
AnswersModel a restaurant reservation system, where staff can a reservation, pull up, cancel reservations. The reservation system is very simple local to just one terminal at the restaurant not connected to network.
- soumi July 27, 2015 in United States for Echo| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer Object Oriented Design - 1of 1 vote
AnswersFind an algorithm to find a word ladder between 2 words by changing just one letter at a time. All the words formed should be valid dictionary words.
- soumi July 27, 2015 in United States for Echo
Eg.
FOOL ->POOL->POLL->POLE->PALE->SALE->SAGE
COLD → CORD → CARD → WARD → WARM| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer Algorithm - 1of 1 vote
AnswersWrite a program in that determines the members and parents of nested groups without using recursion.
These are the requirements.
1. A group can have 0 or more members.
2. A group can be member of one or more groups
3. A group can be member of itself.
4. If there is a path from a group either directly or through multiple hops, then that user is considered as member of the group.
5. A group can have users or groups as members
EX: Input looks like thisvar groupMembers = new Dictionary<string, HashSet<string>> { { "G4", new HashSet<string> { "U1","G1"} }, { "G1", new HashSet<string> { "G2","G3","G6"} }, { "G3", new HashSet<string> { "G3","G5"} }, { "G2", new HashSet<string> { "G4","U2"} }, { "G5", new HashSet<string> { "U2","G6"} }, { "G6", new HashSet<string> { "U3"} }, };
Signature of function is:
private List<MyGroup> FindMembers(Dictionary<string, HashSet<string>> groupMembers)
You need to make sure that you take care of cycles in the graph and not go into infinite recursion.
Output should look like a list of groups where a group is as follows.private class MyGroup { public string Identity { get; set; } public Dictionary<string, MyGroup> MemberOf { get; set; } public Dictionary<string, MyGroup> Members { get; set; } public HashSet<string> Users { get; set; } public MyGroup(string name) { this.Identity = name; this.MemberOf = new Dictionary<string, MyGroup>(); this.Members = new Dictionary<string, MyGroup>(); this.Users = new HashSet<string>(); } }
Each group object should contain all the groups it's a memberOf (directly or indirectly), all the groups that are it's members (directly or indirectly) and all users that are it's members.
- enok July 23, 2015 in United States| Report Duplicate | Flag | PURGE
Google Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersGiven a dependency list of libraries (where an item is: library X depends on library Y) generate a list describing the order in which libraries should be loaded.
- tested.candidate July 13, 2015 in UK
Additional request: detect circular dependencies.| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer Algorithm - 1of 1 vote
AnswersDesign the (content) search autocomplete feature on Kindle
- tested.candidate July 13, 2015 in UK| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer System Design - 0of 0 votes
AnswersA paper consists of a series of consecutive numbers from 1 up to 2^n values. For example,
- vasanthvpsgece June 30, 2015 in India
For case 2^1, content of the paper is,
1 2
For case 2^2, content of the paper is,
1 2 3 4
For case 2^3, content of the paper is,
1 2 3 4 5 6 7 8
There will be n number of commands for 2^n case. Below are the commands,
L – Fold the paper from Left edge to Right edge
R – Fold the paper from Right edge to Left edge
After performing the n number of commands, there will be a single number in all layer of paper, you need to write down the numbers in all layers when you see the paper from upside of it.
Please provide an efficient algorithm.
Example:
Content of the paper (2^3):
1 2 3 4 5 6 7 8
Commands: LRL
Output:
5 4 1 8 7 2 3 6| Report Duplicate | Flag | PURGE
unknown Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersSuppose you have two arrays of objects. How would you find the common elements among them? How would you optimize the solution to avoid additional space?
- Yev June 23, 2015 in United States| Report Duplicate | Flag | PURGE
Centro Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersImplement Priority Queue
- pc June 02, 2015 in India| Report Duplicate | Flag | PURGE
Microsoft Senior Software Development Engineer Algorithm Data Structures - 0of 0 votes
AnswersImplement Least Recently Used Cache for IPAddress lookup. Assume max cache size is 1000 but it should scale well with larger number
- pc June 02, 2015 in India
Key of the cache is server name and value is IPAddress.| Report Duplicate | Flag | PURGE
Microsoft Senior Software Development Engineer Algorithm Data Structures - 1of 1 vote
AnswersGiven a string left rotate it by given number of times with O(n) solution
- pc June 02, 2015 in India| Report Duplicate | Flag | PURGE
Microsoft Senior Software Development Engineer Algorithm String Manipulation