Amazon Interview Questions (part1 - phone screen)
Thursday, September 11, 2008 4:26:38 PM
The program consists of 7-8 months of studying on campus and 2 years of Practical Training.
At the end of December 2007 I started my job search. I never applied for a position at Amazon, I didn't think they would even consider interviewing me, but at the beginning of January I got an email from a HR lady at Amazon asking if I am interested in a Java developer position (SDE) at Amazon (sure as hell I was!). She sent me the description of the job, it was a position at Amazon Fresh team, which would involve Java/RoR/MySQL/Linux knowledge.
We set up the first phone interview for a Tuesday morning.
My interviewer was a lady, she was very nice and had a pleasant voice. First, she introduced herself, where she works, what are her duties and what should expect from this interview.
The interview started with a couple of basic questions:
1. Where do I study
2. What major
3. What courses I took
4. Why did I take those courses
And a couple more.
Then she started asking basic Java questions:
1. What is the difference between an object and a class
2. What is the difference between an interface and a virtual class
3. What is the Java collection framework
4. What is a List, what is an ArrayList
A lot of typical questions about collection framework
Then the algorithms round of questions started.
The first "trick question" was how would you reverse a String. I took a couple of seconds to think, sketched a pseudo-java code and started to dictate to her. She was listening and writing down everything I was saying. Then I remembered of the reverse() method of StringUtils class. I told her that and she said that is what she was looking for, nice!
The second algorithm question was: You have a list of random numbers, what is the quickest way to calculate what is the frequency of each number? From what I remember I used a hashtable to memorize the numbers as the key and the value as the frequency rate:
 -> 1
 -> 4
 -> 12
And so on. Then she asked me what is the complexity of this solution.
The parsing of the list is O(n), where n is the size of the list. Placing the number in the hashtable is ideally in a good written hashtable O(1). Then, traversing the hashtable with results is O(n) and the access of each key/value is O(1) again (considering it's a well written hashtable), so the complexity is O(n) + O(1) + O(n) + O(1) = O(n).
Then she asked me a software design question: describe me the UML diagram of a software that manages restaurant reservations.
The interview lasted about 40 minutes. We got interrupted twice because of bad AT&T signal in Fairfield, Iowa
At the end I asked her why is RoR used at Amazon Fresh, I also asked her if they have any performance issues with RoR. She told me that the traffic load on the Amazon Fresh website is small and RoR is a "quick" solution to some of the taks. For the same reason they use MySQL - not a high load web site.
I had am impression that I did quite well, although the questions seemed very easy. So, I waited for their answer.