Friday, April 23, 2010

Amazon Interview of Sangeeta Pillai

My Amazon Experience:

Amazon interview experience was awesome. I can write an entire blog over it :D. This is not only because I got selected  :P  :P , but also because during the interview you get to meet so many good  and bright people that your motivation to be one amongst them will automatically increase day by day :) :)

Round 1 (Written): It mainly consisted of some normal Puzzles and data structure Qns. I don’t remember them exactly, but they were quite simple.

Round 2 (Telephonic Screening Round): This focused mainly on DS/Algo
Questions were as follows:
1)      A person can climb stairs in 3 ways: Either a single stair at a time or 2 steps together or 3 steps at a time. So, if you have total N stairs give a recurrence relation to solve the above problem.
2)      You have a circle and a point inside it. You have to find the probability of having the point near to center than the circumference of the circle. This one was pretty easy.
3)      Reverse a stack without using Extra memory (U can use recursion).
4)      If I give you a binary number, get me the nearest multiple of 8 which is greater than the number. Use bit manipulations.
5)      Given a cube of size n*n*n (i.e made up of n^3 smaller cubes), find the number of smaller cubes on the surface. Extend this to k-dimension.
6)      There is an array (of size N) with an Element repeated more than N/2 number of time and the rest of the element in the array can also be repeated but only one element is repeated more than N/2 times. Find the number.

Round 3 (Telephonic Screening Round): This focused mainly on coding (any language)
1)      Given a sorted array of Infinite size, find an element ‘K’ in the array without using extra memory in O (lgn) time. (Remember the array size is infinite that is no upper bound) .I was asked the approach first and then the code. I gave a C code.
2)       Given a doubly linked list such that every node has not only next, previous pointers but also an extra pointer called child pointer that points to some arbitrary node out of the given DLL. But the child Node itself can be part of another bigger linked list. Now write a code for flattening the linked list .remember the child node can itself have its own child nodes and so on ….Hence the level of this hierarchy can go on….
3)      Once you get the output of the above question, write a code to reconstruct the original DLL from the output.
4)      Design a Jigsaw Puzzle with appropriate data structures and give function signatures for the game.








Round 4 (Face 2 Face Interview) The TL of the team which was hiring took this interview
1)      Given an array of size N such that both of its 2 halves are sorted individually. Now we need to sort the entire array with O(1) space . Give the psuedocode for the same.
2)      Find the first K smallest element from 1 million sized array . Assume your ram memory is so small that it cannot accommodate all 1 Million element at once.
3)      What are threads? -- > Race condition à Semaphores àdeadlocks ---- etc etc etc
4)      What is synchronization in Java and what does the synchronization method do. If you have to develop your own synchronization method, how will you proceed?
5)      Given an array all of whose elements are positive. You need to get maximum sum of a subsequence such that no 2 numbers in the sequence should be adjacent in the array. So  4 2 6 10 should return 14
6)      Why Amazon?

Round 5 (Face 2 Face interview) Manager of the hiring Team Took this interview
1)      Tell me about yourself , your work in Kuliza etc etc…
2)      What do you know about Amazon (both as a product and as a company)
3)      Design a Parking Lot using Java classes and data structures like Vectors , hashmaps etc.This question took most of the time .Although I was able to come up with a logically correct design but still he seemed to be dissatisfied as I missed out quite a lot edge cases, which he said are very important and should never be ignored …..

Round 6 (Face 2 face interview) This was taken by a senior developer.
1)      Design and code a crossword puzzle. I was asked to first tell the DS that I m going to use and then the approach. After this he asked me to code my approach.
2)      Given a string , pattern and error count  we need to write a function which return true or false based on the fact that whether the string matched the pattern with an error value given as error count. i.e. suppose string is : “abcdef”  and the error count is say 2 and the pattern is “adef” , then there are exactly two characters missing in pattern to form the string , hence there is a match.
Simialry with the same string “abcdef” , the pattern “adef”  as well as “atcdyf” also matches with error count 2 since in the former there is 2 deletions and in latter there are two replacements.
Write an optimized code to implement the function.
3)      Given a 2X2 matrix. Find all valid words ( a dictionary being given) present in all rows, columns and diagonals in the matrix in the most optimized manner. Write Code also.

Round 7 (BAR RAISER) Betta ,  isme to lag gayi…
The specialty of Bar raiser round is the fact that here you will be interviewed by 2 interviewers at the same time. Although only one of them  may be asking qns , but the other one would constantly be observing you and making notes of your spontaneity , enthusiasm ,  and of course  attitude. The one who asks qns will concentrates on your approaches and code.
Instead of giving the questions, I would like to give my suggestions over here coz I felt that your attitude matters the most here.
For clearing this round I will suggest the following:
a)      Never lie in your resume.
b)      Never write about project or technologies on your resume which you are not confident about.
c)      Tell the truth and be honest .It will help.
d)      Tell the roles played by you in your current company in as much detail as possible.
e)      Whenever you are answering any qn (be it designing or coding) , start from simpler soln and go ahead with optimized ones.
f)       Don’t think that your answer may be stupid, because those may indeed be the answers that they are looking for.
g)      They asked me few DS/Algo questions which were easy to start with like they wanted me to store names, marks and other details of students in a school. Then they started adding constraints to their problem like O (1) time retrieval, O (1) time insertion and all. Whenever I suggested a DS, they would introduce a new constraint and so on .Basically they were pushing me to the right DS . I ended up with hash tables but still in hash table we can have collisions because the key here was not ID of student but last name, first name combination. They now wanted me to give them a hashing algo which introduces no collision. (solution : Perfect Hashing)
h)      In this round there is no chance that you get familiar questions. So, don’t get disappointed by the questions as it is also possible that the qns may not have any optimized answers. For e.g. they asked me an NP complete problem. I tried my level best sitting there trying to figure out the optimized solution. I gave them many solution, but all failed some or the other way .In the end they told me that it was NP complete .But throughout the discussion for the question the person observing me was making notes and the person asking the questions was giving me hint just to ensure that, if given hints will I be able to progress ……

Round 8 (Final Round) Finally, the Hiring manager round. The person who took this interview was the Project manager for the hiring team.
He asked me questions related to Oops and since in KULIZA I worked on java also, he asked me some amount of java also like difference between hash maps and hash  tables , refection methods in java etc..
Since In Kuliza, we use Spring framework for our web –applications, he asked some basic questions about MVC framework also.
In the end he asked me a puzzle, which I was able to solve after he gave me a hint.
Interview was over after his and I went home. J

No comments:

Post a Comment