SDE-2 Interview Questions
- 0of 0 votes
AnswerDesign the "what other people bought feature." This was focused on database design/creating an api to lie on top of it, and he asked questions to see if I understood how dbs actually work(like what does group by do). I was given an example table with the schema of like
- steez June 22, 2015 in United States for android amazon app, social shopping
itemID, purchaseDate, customerID
He asked big O complexity of sql query as well.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design - 0of 0 votes
AnswersDesign Amazon Questions and Answers. This question was to see how I code, and how I would modularize things. He wanted me to code every single thing as realistically as possible on a whiteboard.
- steez June 22, 2015 in United States for android amazon app, social shopping| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design - 0of 0 votes
AnswersDesign a push notification system for android. Assume that we have 1 million users this year, but next year we will have 15 million. Assume that Google can handle infinite notifications per second.
- steez June 22, 2015 in United States for android amazon app, social shopping
I would love to see this answered, as I did not answer it well.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design - 0of 0 votes
AnswersYou are given a String S that consists of characters '0' and '1' only.Return the smallest positive integer K such that it is possible to cut S into K pieces, each of them being a power of 5. If there is no such K, return -1 instead.
- neer.1304 June 15, 2015 in India
Examples
0)
"101101101"
Returns: 3
We can split the given string into three "101"s.
Note that "101" is 5 in binary.
1)
"1111101"
Returns: 1
"1111101" is 5^3.
2)
"110011011"
Returns: 3
Split it into "11001", "101" and "1".
3)
"1000101011"
Returns: -1
4)
"111011100110101100101110111"
Returns: 5| Report Duplicate | Flag | PURGE
Flipkart SDE-2 Algorithm - 18of 18 votes
AnswersDesign an Email sender, need to send 100,000000 emails and you have 5 machines how could you do it efficiently.
- shaileshagarwal1 June 15, 2015 in India for Transportation Team| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design - 0of 0 votes
AnswerGiven an URL you need to analyze all the images( they may be in 1000’s of number) and return the cumulative quality of images present in that url.
- shaileshagarwal1 June 15, 2015 in India for Transportation Team
lets say: you can configure image quality as very good, good, average, poor..etc, so you have to return one value among them.The given URL may contain several other URLs and they also contain lot of images . you need to consider all of them. lot of questions like how to avoid visiting same url again,
how would you determine the quality of an image if you encounter an url that contains only an image..etc.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design - 0of 0 votes
AnswersDesign Elevator system. And then write an algorithm for that Design such that, the user request should be completed in logN time in a N story building with M elevators.
- shaileshagarwal1 June 15, 2015 in India for Transportation Team| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design - 0of 0 votes
AnswerIn an online teaching system, there are n number of teachers and each one teaches only one subject to any number of students.
- shaileshagarwal1 June 15, 2015 in India for Transportation Team
And a student can join to any number of teachers to learn those subjects.
And each student can give one preference through which he can get updates about the subject or class timings etc.
Those preferences can be through SMS or twitter/facebook or email..etc.
Design above system and draw the diagram for above.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design - 0of 0 votes
AnswersHow to debug deadlock or heap corruption from DUMP using WinDbg tool?
- pc June 08, 2015 in United States| Report Duplicate | Flag | PURGE
Microsoft SDE-2 Debugging - 0of 0 votes
AnswersDesign classes and interface for BookShelf
- pc June 08, 2015 in United States| Report Duplicate | Flag | PURGE
Microsoft SDE-2 design - 1of 1 vote
AnswersGiven a file, read last n lines from the file
- pc June 08, 2015 in United States
string ReadNLines(sttring fileName, int n);| Report Duplicate | Flag | PURGE
Microsoft SDE-2 Algorithm - 0of 0 votes
AnswersIdentify the output
- SantoshSingh June 02, 2015 in IndiaClass A { } Class B { } B b = new B(); A a = (A) b; sysout(b.getClass()); sysout(a.getClass());
| Report Duplicate | Flag | PURGE
Oracle SDE-2 - 0of 0 votes
AnswersGiven Two classes A & B. How will B know if an instance of A is already created?
- SantoshSingh June 02, 2015 in India| Report Duplicate | Flag | PURGE
Oracle SDE-2 Java - 0of 0 votes
AnswersLog file contains UserId.Every day has new log file.Given range of n days find top 10 users?
- dkaminfotech May 23, 2015 in United States| Report Duplicate | Flag | PURGE
Expedia SDE-2 design - 0of 0 votes
AnswersGiven an int[] multiply all numbers except index I/p {1,2,3,4} O/P {24,12,8,6} How can you minimize multiplication
- dkaminfotech May 23, 2015 in United States| Report Duplicate | Flag | PURGE
Expedia SDE-2 Algorithm - 0of 0 votes
AnswersMove all zeros to beginning input {1,2,3,0,0,0,4,5} output {0,0,0,1,2,3,4,5}
- dkaminfotech May 23, 2015 in United States| Report Duplicate | Flag | PURGE
Expedia SDE-2 Algorithm - 0of 0 votes
Answersclass Node{ int nodeId,int nodeParentId} is given.
- dkaminfotech May 23, 2015 in United States
Input : List<Node>
Output:Tree| Report Duplicate | Flag | PURGE
Expedia SDE-2 Algorithm - 0of 0 votes
AnswersDesign TIC TAC TOE problem
- dkaminfotech May 23, 2015 in United States| Report Duplicate | Flag | PURGE
Expedia SDE-2 design - 4of 4 votes
AnswersGiven a big rectangular plot of land that has rectangular or square sized buildings (all sides of every building are parallel to the big rectangular plot)... find the location and dimensions of the largest square that can be built in this rectangular plot
- JSDUDE May 18, 2015 in United States| Report Duplicate | Flag | PURGE
Microsoft SDE-2 Algorithm - 3of 3 votes
AnswersFind the number of bits set in a given character array.
- JSDUDE May 18, 2015 in United States
After giving him a bit wise operation that was O(n) where n is the number of bits set, he wanted a more optimum solution| Report Duplicate | Flag | PURGE
Microsoft SDE-2 Bit Manipulation - 4of 4 votes
AnswersGiven an array of integers and a number. WAP to find the pairs which sum of upto given number.
- Nitin Gupta May 15, 2015 in India for Cloud & Enterprise team
I solved it. Then he asked about writing test cases for this function.
I wrote below test cases
1.) All the elements should be number.
2.) Length of array should not be 0.
3.) Array itself should not be null.
4.) Given number, arrayLength can be represented by 32bits or 64 bits.
5.) number should not be negative.
6.) Input does not has pair, It should return false
7.) Input has pair, It should return true
8.) Input has all negative values and pair exists, then function should return true
9.) Input has all negative values and pair does not exists, function should return false
He told that he is looking for more test cases. Can you guys think of some more complex test cases.| Report Duplicate | Flag | PURGE
Microsoft SDE-2 Algorithm Arrays C++ Data Structures - 1of 1 vote
AnswersYou are given a catalog of books, which have following attributes :-
- neer.1304 May 14, 2015 in United States
Name, Author, Publisher, Publish year, Category, Price, Count (sold)
Implement following APIs on top of this catalog -
1) addBookToCatalog(Book)
2) searchBook(by partial book name/author)
3) getMostSoldBooks(by author name/category, limit)
Expectations:
Maintain DB on memory
Code should be readable. Design, handle naming convention,handle exceptions & should be running| Report Duplicate | Flag | PURGE
Flipkart SDE-2 Algorithm - 0of 0 votes
Answersdesign snakes and ladders game(multiplayer). extend it so that it can be hosted overs a server and played over a server
- aditya.eagle059 May 08, 2015 in India| Report Duplicate | Flag | PURGE
Flipkart SDE-2 - 0of 0 votes
Answersgiven daily stock rates of last year give the average stock rate price for a given day range
- aditya.eagle059 May 08, 2015 in India| Report Duplicate | Flag | PURGE
Flipkart SDE-2 - 0of 0 votes
Answersgiven n-ary tree. zigzag level order traversal.
- aditya.eagle059 May 08, 2015 in India| Report Duplicate | Flag | PURGE
Flipkart SDE-2 - 0of 0 votes
Answersgiven unsorted array and a number K. Find 2 numbers such that sum is K
- aditya.eagle059 May 08, 2015 in India| Report Duplicate | Flag | PURGE
Flipkart SDE-2 - 0of 0 votes
Answersthere are M chocolate packets each packet can have variable number of chocolates in each packet.
- aditya.eagle059 May 08, 2015 in India
There are N students (N<M).
Distribute chocolate packets to student such that
1) each student gets 1 packet
2) suppose m1,m2,...mn are the packets which are chosen to be distributed in sorted order of number of chocolates in them (nm-n1 must be minimum)
M = 1, 3, 4, 6 (4 packets with specified number of chocolates in them)
N = 2
Ans = 3,4| Report Duplicate | Flag | PURGE
Flipkart SDE-2 - 0of 0 votes
AnswersYou have an organizational structure, which shows hierarchy of the organization. This hierarchy contains employees E or managers M who has some Employees or Managers reporting to M. Employee has ( id, name, JobDesc, salary etc). Design the data structure you would be using to store this hierarchy
- neer.1304 May 07, 2015 in United States
1: Given an ID of an employee , print all the employee ID's who are directly reporting or indirectly reporting to the manager.
2. Given a bonus and performance rating of each employee divide it to the lowest level employees(in the hierarchy ) in the ratio of their rating. i.e 100 divided among 2:3 is 40 and 60. and print the bonus of each
3. Top 10 employees with ratio of bonus:salary
Note :-
1) Employee can have only 1 mgr, and a mgr has 1+ employees.
2) Input can be in any order for ex- employees might be input before his manager.| Report Duplicate | Flag | PURGE
Flipkart SDE-2 Algorithm