SDE-2 Interview Questions
- 0of 0 votes
AnswersThere is a bucket N which contains n nuts of different
- ronnie July 14, 2013 in India for Video processing capabilities
sizes and bucket M of m bolts. Also there is a compare function which will take one bolt and a nut as input and return -1,0,1, respectively if nut size greater, equal, or lesser than bolt. Write an algorithm to find matching nits and bolts. Initially he gave sizes for nuts and bolts instead of compare function so i made use of hash map and solved it. So after that he gave this function and asked if there is a better soution than O(mn) ?| Report Duplicate | Flag | PURGE
Cisco Systems SDE-2 Algorithm - 0of 2 votes
Answersgiven two arrays of same size, arrange the arrays such that a1*b1 + a2*b2 + .... + an*bn should ne minimum.
- pavi.8081 July 11, 2013 in India for Fraud prevention| Report Duplicate | Flag | PURGE
Amazon SDE-2 Arrays - 0of 0 votes
AnswerDesign the juglee.com.
- pavi.8081 July 11, 2013 in United States for Online Fraud Prevention
Write objects involved and their properties, behaviour and interactions.
Make valid and practical assumptions and design.
Please let me know your approach to this design questions.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Object Oriented Design - 0of 0 votes
AnswersDesign a Dropbox invite system (refer other guys to join and get more space)
- pavi.8081 July 11, 2013 in United States for Online Fraud Prevention
Assume whats required and design.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Object Oriented Design - -5of 7 votes
AnswersAlgorithm to find square root of an algorithm
- parag June 27, 2013 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 6of 6 votes
AnswersIn a certain language which has same alphabets as in english language (ie. a-z), but the order of the alphabets is different (for eg 's' is the first character, 'g' is second, and likewise). Given a dictionary of this new language (which has words arranged according to new alphabetical order), FInd out the order of alphabets in this language.
- sgarg June 09, 2013 in India| Report Duplicate | Flag | PURGE
Amazon Google SDE1 Software Engineer / Developer SDE-2 Algorithm - 3of 3 votes
AnswersConsider an array of integers wherein each element is +1 or -1 its preceding element. Given a number, find the first occurence of this number (index) in this array without using linear search.
- nilukush June 04, 2013 in India for World Wide Operations
For example, consider the array :
4 5 6 5 6 7 8 9 10 9 10 (each element in this array is +1 or -1 its preceding element)
Input : 10 (find first occurence of 10 without using linear search)
Output : 8| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm Arrays - 1of 1 vote
AnswersAn array contains N numbers where N is huge. There are only k distinct numbers. Sort those k numbers.
- Rahul May 22, 2013 in India
I tld him to use a hashmap for this. He was fine with the solution. But he wanted me to optimise it for a multicore machine. I couldn't come up with an answer. :(| Report Duplicate | Flag | PURGE
SDE-2 Algorithm - 1of 1 vote
AnswersPairwise swap elements of a given doubly linkedlist.
- BVarghese May 09, 2013 in United States
Node has prev and next pointers.| Report Duplicate | Flag | PURGE
Adobe SDE-2 Algorithm - -14of 16 votes
AnswersFor 2 given array a[] and B[], find the highest index of A such that logical array A[0...i] and A[N-1...N-1-i] are same.
- Razz May 06, 2013 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 Arrays - 0of 0 votes
AnswersDesign a MMORPG game in internet scale. Assume only available action for the players is watch and move.
- deep0mal April 16, 2013 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Object Oriented Design - 0of 0 votes
AnswersGiven a matrix that contains 0s and 1s, find the shortest exit and print the path. You can navigate in top,bottom,left or right directions.
- deep0mal April 16, 2013 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersIn a stream of numbers, keep track of 1 million max numbers.
- deep0mal April 16, 2013 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 1of 1 vote
Answersfind the Langford sequence for a given N if it exists? Details of Langford sequence - https://en.wikipedia.org/wiki/Langford_pairing
- deep0mal April 16, 2013 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersDesign a task scheduler
- pavi.8081 April 10, 2013 in United States for STB and MVO| Report Duplicate | Flag | PURGE
Microsoft SDE-2 Object Oriented Design - 0of 0 votes
AnswersDesign a vending machine.
- pavi.8081 April 10, 2013 in United States for STB and MVO| Report Duplicate | Flag | PURGE
Microsoft SDE-2 Object Oriented Design - 0of 0 votes
Answersarray of numbers are given. WAP to find the sum of contiguous subarray within a one-dimensional array of numbers which has the largest sum.
- pavi.8081 April 10, 2013 in India for STB and MVO
Follow up: After writing program to return the largest sum modify it to return the start and end index of such a subarray.| Report Duplicate | Flag | PURGE
Microsoft SDE-2 Algorithm - 0of 0 votes
AnswersGiven an array with source code and braces (braces means '{' or '}' ) intermixed. WAP to return true of braces are balanced (implies that for each opening brace there must be a closing brace and for each closing brace there must be opening brace) and false otherwise.
- pavi.8081 April 10, 2013 in India for STB and MVO| Report Duplicate | Flag | PURGE
Microsoft SDE-2 Algorithm - 0of 0 votes
AnswersGiven a pattern P and a text T, WAP to return all indices from T where P matches.
- pavi.8081 April 10, 2013 in India for STB and MVO| Report Duplicate | Flag | PURGE
Microsoft SDE-2 Algorithm - 1of 3 votes
AnswersPosition of Knight is given on a chessboard.
- pavi.8081 April 10, 2013 in United States for STB and MVO
Return me something (adjacency matrix or list or anything) which shows all
the positions the knight can reach upto from a given position.
I must be able to tell, from what is returned, if the position is reachable or not
and if reachable I must be able to trace the path from given position to target position
<<FOLLOW-UP>>
For example if 4 cells are reachable from a cell A, then these 4 cells become children of A.
Then from a cell, say B, out of these 4 cells, you can reach 2 more cells: C and D. Then C and D become children of B.
Likewise program need to return me a DS. I have given a valuable hint with this follow-up. I hope this will help| Report Duplicate | Flag | PURGE
Microsoft SDE-2 Algorithm