Senior Software Development Engineer Interview Questions
- 0of 0 votes
AnswerWhats the difference between quick sort and merge sort? Which one to use? Do we need file sorted before merge sort?
- newbee September 17, 2014 in United States| Report Duplicate | Flag | PURGE
Intuit Senior Software Development Engineer Sorting - 0of 0 votes
AnswerDesign a system for elevator and write all the classes and interfaces and show the relationships in between them.
- newbee September 09, 2014 in United States| Report Duplicate | Flag | PURGE
Nook Senior Software Development Engineer Object Oriented Design - 0of 0 votes
AnswersWhat is out in System.out.println(). How can we redirect System.out.println to file than showing on console? Say we have
- newbee September 09, 2014 in United States
System.out.println("Hello World!!"). We want "Hello World!!" written to file than showing on console.| Report Duplicate | Flag | PURGE
Nook Senior Software Development Engineer Java - 0of 0 votes
AnswerWrite code for tree traversal. If we have cyclic dependency in tree, say child is pointing to parent, how can we traverse it?
- newbee September 09, 2014 in United States| Report Duplicate | Flag | PURGE
Nook Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersA file of encoded message contains only numbers. Original message contains only lowercase letters and spaces. So character ‘a’ is mapped to 1 ‘b’ to 2 and so on till ‘z’ is mapped to 26. Given an input of numbers find out the number of ways you can decode it in original message. Eg. 123 can be decoded in 3 ways as ‘abc’, ‘lc’ or ‘aw'
- MVVSK August 22, 2014 in India| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersConsider the following class definition:
- newbee August 19, 2014 in India
class Node {
List<Node> children;
void addChild (Node child);
}
Assume you have a node object like above. This node object can contain a child node object. Assuming you are given one of these objects, write a function to determine the maximum path length from the root node to the most distant remote node. .| Report Duplicate | Flag | PURGE
Flipkart Senior Software Development Engineer Algorithm - 12of 12 votes
AnswersGiven a mapping of alphabets to integers as follows:
- skrish August 13, 2014 in United States
1 = A
2 = B
3 = C
...
26 = Z
Given any combination of the mapping numbers as string, return the number of ways in which the input string can be split into sub-strings and represented as character strings. For e.g. given
"111" -> "AAA", "AK", "KA" -> 3
Valid combinations are ({1,1,1}, {1,11},{11,1}) = 3
"11" -> "AA", "K" -> 2
Valid combinations are ({1,1},{11}) = 2
"123" -> "ABC", "LC", "AW" -> 3
Valid combinations are ({1,2,3},{1,23},{12,3}) = 3
You don't have to return all the mappings, only the number of valid mappings.| Report Duplicate | Flag | PURGE
Facebook Senior Software Development Engineer String Manipulation - 2of 4 votes
AnswersFind the maximum depth of binary tree?
- skrish August 13, 2014 in United States
Once I wrote the code for this, interviewer asked me next question| Report Duplicate | Flag | PURGE
Facebook Senior Software Development Engineer Algorithm - 0of 0 votes
Answersin a Hadoop-like system, how do we manage multiple nodes collaborating together without having a master node?
- Itcecsa August 13, 2014 in United States
my answer was running a back end job to randomly select a node to be a master node; and whenever the master node goes down, the backend job select a new node.| Report Duplicate | Flag | PURGE
Bloomberg LP Senior Software Development Engineer System Design - 0of 0 votes
AnswersGiven the following structure Record and we have million of records on disk.
- Itcecsa August 13, 2014 in United States
struct Record
{
char[257] name;
int startTime;
char[257] description;
}
Now we want to keep a in-memory cache which is represented in class ManageRecords to perform 2 methods GetDesriptions and GetRecords. Given that we have very big memory and we can use any data structure so that the 2 methods can be performed really quick. Here are the questions:
1. what should be the return type for method GetDesriptions
2. what should be the return type for method GetRecords
3. what data structure should we use in the private part as commented out below
class ManageRecords
{
public:
ManageRecords();
? GetDesriptions(char[] name);
? GetRecords(int begin, int end); //do a range search based on startTime of structure Record
private:
// what data strcture should we use here?
}| Report Duplicate | Flag | PURGE
Bloomberg LP Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersGiven a string and a number k, break the string up into tokens and return the k most frequently occurring tokens. The algorithm should take O(n) time, where n is the length of the string.
- rangarajan.chari July 16, 2014 in United States| Report Duplicate | Flag | PURGE
Senior Software Development Engineer Algorithm - 1of 1 vote
AnswersDesign an algorithm for a thermometer that shows the Maximum and minimum temperature in the last 24 hours. The current temperature can be read in 5 second intervals.
- CodingDawg May 10, 2014 in United States
The interviewer was looking for an algorithm that is space efficient as there will be limited memory on the device. .| Report Duplicate | Flag | PURGE
Groupon Senior Software Development Engineer Algorithm - 1of 1 vote
AnswersInput will be a matrix consiting of only 1's n 0's.
- im.akki90 April 21, 2014 in India
The 1's represent the lines and 0's its absence.
For eg a matrix 6X7 is shown
0 0 0 1 1 1 1
0 1 1 1 0 1 1
0 1 0 1 0 1 1
0 1 0 1 0 1 1
0 1 1 1 0 1 1
0 0 0 1 1 1 1
In the above matrix, the sequence of 1’s represents the lines. These eight lines constitute three
rectangles.
Conditons :
1. The rectangles will always enclose some 0’s. e.g. last two vertical lines does not constitute a
rectangle.
2. A rectangle can contain multiple rectangles
Output : should be no. of rectangles formed in the matrix(intersecting rectangles are also counted).| Report Duplicate | Flag | PURGE
McAfee Senior Software Development Engineer Java - 2of 2 votes
AnswersI/P: An array of Integers: which will be used to construct a binary search tree in the order they appear.
- poorna.chandra.akp April 20, 2014 in India
o/p: all permutations of the input elements which will result in the same Binary Search tree as the one formed with the input array.
Eg:
I/P: 4, 3, 1, 2, 6, 5, 7
o/p:4 , 6, 3, 7, 5, 1, 2
4, 3, 2, 1, 6, 5, 7
and soo on.| Report Duplicate | Flag | PURGE
Directi Senior Software Development Engineer - 0of 0 votes
AnswersSuppose your team needs to launch a new recommendation feature called “Stuff Your Friends are Buying”. The recommendation logic is based on the following rules:
- nikitaamalhotra1991 March 28, 2014 in India
• A customer should only be recommended product that their friends bought but they haven’t bought.
• The recommendations priority is driven by how many friends have purchased the same item – if multiple friends purchased the same item, it should be higher in the recommendations than a product that only one friend owns.
You are provided two library functions to help you
• getFriendsListForUser – returns a list of customer IDs (strings that uniquely identify an Amazon user) representing the friends of an Amazon user
• getPurchasesForUser – returns a list of product IDs (strings that uniquely identify an item in the Amazon catalog) for an Amazon user ordered by purchase time with newest purchase first in list and oldest purchase last in list
For this evaluation, please:
1) Write a function that provides a ranked (high to low) list of recommendations (product IDs) for a provided user.
2) Write code for a few key unit tests for your code.
3) Enumerate other unit test scenarios (code not required).
4) Provide the space and time complexity of your solution.| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer - 0of 0 votes
AnswersGiven a bunch of floors....and egg will break only if it is thrown from a floor and any floor above that....what least number of eggs u would need if total floors are say 32..
- cvb February 20, 2014 in India
I went with binary search..where I strt from middle...throw the egg, if it doesnt break...
go to middle of upper half and if it does break..i know I should go to middle of lower half.| Report Duplicate | Flag | PURGE
Myntra Senior Software Development Engineer Dynamic Programming - -4of 6 votes
Answera Bunch of devices....u can share files etc.,..each device might support only some limited
- cvb February 20, 2014 in India
format of files. A common server hosting all the files repository.| Report Duplicate | Flag | PURGE
Myntra Senior Software Development Engineer System Design - 0of 0 votes
AnswersIf every leaf node in binary tree forms a double linked list...that is
- cvb February 20, 2014 in India
all the leaf nodes for a DLL.
ex:
1
/ \
2 3
/ \ / \
4 ......5....6.......7
.........................
print all the leaf nodes....
This involves first identifying leaf node. We can do that by checking at every node, if the its child points right back at the parent..then parent is leaf node.
After this it is simple traverssal of DLL and printing nodes.
Level order traversal.
Mirror image of tree
Ancestor in binary tree.| Report Duplicate | Flag | PURGE
Myntra Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersFirst round
- cvb February 20, 2014 in India
Given set of coins of different denominations....
like 1$ (100)....5$(50)...etc., and given an amount..I was asked to come up with optimal solution
using least number of coins to get that amount.
I told greedy approach of starting wiht maximum denomination coin..use up as much as possible...then moving on to next..I was asked to tell dynamic programming approach...
..I told I will split the amount in half..and keep doing it until i reach 1 1 ..combination..start calculating optimal combination..and keep going up like ...
Next question was to try and implement google autosuggest...I told i will use tries...pseduo code and some optimizations on top of it.| Report Duplicate | Flag | PURGE
Myntra Senior Software Development Engineer Algorithm - 2of 2 votes
AnswersThis question was a modification of question 1 in this telephonic interview
- poorna.chandra.akp February 12, 2014 in India for digital
i/p: Binary Tree
O/p: print all the pairs along a path to leaf nodes, which don't follow BST property.
Eg:-
7
2 19
8 5 12 17
13 21
46
http://pastebin.com/raw.php?i=BqrNz9pu
o/p: (8,2), (8,7)
(13, 5) ( 13, 7)
and soo on.| Report Duplicate | Flag | PURGE
Flipkart Senior Software Development Engineer - 1of 1 vote
AnswersI/P: chronological order of stock value of a particular company
- poorna.chandra.akp February 12, 2014 in India for digital
O/P: Maximum profit when you buy on a day and sell on another day.
Eg:
i/p: 79 14 3 21 104 54 12 9 94 1 96 101 5
o/p: 101| Report Duplicate | Flag | PURGE
Flipkart Senior Software Development Engineer - 0of 0 votes
AnswersI/P: Binary Tree
- poorna.chandra.akp February 12, 2014 in India for digital
O/P: Print the all pairs which do not follow BST property.
Eg:-
I/p:
7
2 19
8 5 12 17
13 21
46
Looks like formatting is screwed for the binary tree.
http://pastebin.com/raw.php?i=BqrNz9pu
o/p: (8,2) (8,5) (8,7) (13,5) (13,7) (13,12) (19,17) (21,17) (46,17) (46,21)
I told the interview that I would store the inorder traversal of the input binary tree to an array and print out the inversions.
By inversion, I mean if i<j and then if a[i] > a[j]| Report Duplicate | Flag | PURGE
Flipkart Senior Software Development Engineer - 0of 0 votes
AnswersI have recently attended Amazon Interview and got rejected after design round, its happened three times with Amazon in 2 year, i always getting rejected because of design round. please help me to know how should i answer an design question. questions like 1) design elevator control system 2) design whisper-sync feature (used in Amazon instant video platform) they ask me to design End to end HLD LLD i did not get what exactly differ in both, i explain as a algorithm wise, but could not properly by HLD and LLD.
- ashishbansal1986 February 10, 2014 in India
i mean i searched alot, but could not found a way to answer such question.
Any help will be good for me.
Thanks,| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer Distributed Computing - 0of 0 votes
AnswersGiven an input string and a dictionary of words, find out if the input string can be segmented into a space-separated sequence of dictionary words. You need to output the minimum number of words. For example, input: "aaaisaname"
- keepworking February 05, 2014 in United States for general
dict: ("a", "aaa", "is", "name")
output: "aaa is a name"
Wrong output: "a a a is a name"| Report Duplicate | Flag | PURGE
Pinterest Senior Software Development Engineer Algorithm - 1of 1 vote
AnswersImplement a sudoku solution verifier function. The rules for sudoku is this:
You have a 9 by 9 board. This board is divided into nine rows, nine columns, and nine 3x3 blocks. In a solved puzzle, every row, every column, and every 0 block has to contain each of the digits from 1 to 9. This is an example of a solved puzzle:
- .·´¯`·.´¯`·.¸¸.·´¯`·.¸><(((º> February 05, 2014 in United States248|395|716 571|628|349 936|741|582 ---+---+--- 682|539|174 359|174|628 714|862|953 ---+---+--- 863|417|295 195|286|437 427|953|861
| Report Duplicate | Flag | PURGE
Google Senior Software Development Engineer Algorithm - 1of 1 vote
AnswersA(1) = ()
- poorna.chandra.akp February 04, 2014 in India
A(2) = (())
A(3) = (()) ()
A(4) = (())() (())
A(5) = (())()(()) (())()
A(N) = A(N-1) + A(N-2)
I/P: N, i
O/P: A(N).charAt(i);
Interviewer was not looking at iterative or recursive solution. He was looking at a closed form solution.| Report Duplicate | Flag | PURGE
Flipkart Senior Software Development Engineer - 0of 0 votes
AnswersTest cases for int rand() which returns a random number between 0 - 999
- IntwPrep.MS January 17, 2014 in United States for Bing| Report Duplicate | Flag | PURGE
Microsoft Senior Software Development Engineer - 2of 2 votes
AnswersGiven a number give its english form
- IntwPrep.MS January 17, 2014 in United States for Bing
1-> One
999 -> Nine hundred and ninety nine
Max number is: 999, 999, 999| Report Duplicate | Flag | PURGE
Microsoft Senior Software Development Engineer - 0of 0 votes
AnswersDesign a webservice which would take a word, and return all anagrams
- IntwPrep.MS January 17, 2014 in United States for Bing| Report Duplicate | Flag | PURGE
Microsoft Senior Software Development Engineer - 2of 2 votes
AnswersGiven a graph that where A->B indicates that node A should be processed before processing B. Design an parallel algorithm to process all the nodes
- IntwPrep.MS January 17, 2014 in United States for Bing| Report Duplicate | Flag | PURGE
Microsoft Senior Software Development Engineer