Exploring Thoughtz..

My Amazon Interview Questions

Posted by: Vijay Dev on: September 19, 2007

When I attended Amazon off campus interview a few months back, I recorded the experiences there as a page. Since I no longer like it being there (reminding me that I was a student :) ), I had removed it. But here’s the content of that page -

I attended Amazon Off campus on 24th Jan 2007 at Ascendas. This is the first time I am attending an off campus interview. My test performance was below average, yet got shortlisted for the interviews along with 14 others. The interviews were held today and i cleared the first round with ease, but got bumped in the second round. Rajiv and Rave got selected at the end..

The test was purely technical and had SQL, Unix etc. So i messed it up !! And the interview was fairly ok ! I got my first round with Sriram and another guy (whose name i forgot :-) he was a IITB fresher) who were software developers at Amazon. The interview was very cool and friendly with Sriram firing a lot of questions, jocularly telling that being a 9 pointer you must answer all !! He was very much surprised about my CGPA being 9.231 :)

Some of the 1st round questions are

1. You are provided with a stream of numbers, design a data structure to store the numbers in the stream along with their no. of occurrences.

I told him to use a Trie and he asked me why not BST, and asked me to compare both..

2. Given two sorted arrays A1 and A2, of lengths L1 and L2 , L1 < L2 and the last L1 slots in A2 are vacant, get me all the numbers in A2, sorted in the most efficient manner without using extra space. This was a written test question in which I blabbered quick sort will do..

In fact the answer was merge sort. I misunderstood the question a bit and was thinking in some other direction. But after he clarified the question, I wrote the code in a flash !!

3. In a array of size n , there is one number missing and one number repeated twice. Find them.

I was a fool not to notice the sum of numbers and sum of squares of numbers property immediately. But after getting a clue, I answered it.

Then there were many OS questions and one question to explain 3-way handshake in TCP, and some funny chats !! He called me the coolest among the 3 people he interviewed and God only knows why :-)

And then, the 2nd round.. Terrible.. I got Dharmaraj, CEG Alumni 2000, to interview me !! He is one of the MOST intelligent to pass out of CEG, I am told !! He had worked in MS, Trilogy etc. And this guy found a bug in my written test code. I missed a free() for a pointer which I malloc()’ed :-(

And so it started. He asked about the effects of missing a free() and I answered it. Then came the big blow. He asked me to write code for malloc(). It involved a lot of discussions and nearly 45 min were spent on this. But eventually i dint write code. And he was pretty happy with the discussion or it seemed so !

Next one was still more crazy ! It is concerned about Page Number Identification in OCR output of books. Though I went mad, I still managed to understand the problem and discussed it with him. Although I could not find an answer to his question, he was extremely supportive and asked me to relax and all that. In the end, it turned out to be disappointing, though. If I were in his place, I would have bumped myself !

But on the whole, it was a good learning experience for me with some new questions coming out. I now look forward to some other off campus choices… Hope to get a good offer soon !!

6 Responses to "My Amazon Interview Questions"

[...] Check it out Filed under: College   |   [...]

Hey..I am in my third year. I recently appeared for an internship interview for amazon during campus placements in my college…..I was asked questions on pretty much the similar lines.

I was asked BFS,DFS, and we manouvered a long way on the complexity issue….which I was not much aware of.

Job at amazon would be my dream job..

Hi Nigam !

Good to hear from you. My Best Wishes for you to achieve your dream job ! You still have a lot of time to prepare yourself for the challenges ahead ! Things like complexity can be easily understood more by practice than by reading theory. Of course, math basics help :)

Hi Vijay,
what is the answer for 3rd question?

In a array of size n , there is one number missing and one number repeated twice. Find them.

Please elaborate on this… Thanks.

Sum of n natural numbers = n(n+1)/2
Sum of squares of n natural numbers = n(n+1)(2n+1)/6

now let the missing number be A and repeated number be B

then |A-B| = n(n+1)/2
and |A^2-B^2| = n(n+1)(n+2)/6

Two equation and 2 variables…..easy

Need some modification in ur equation

actual sum – A + B = n(n+1)/2

actual sun of Square -A^2 + b^2 = n(n+1)(n+2)/6

Leave a Reply

Blog Stats

  • 22,081 Visitors

  • Yann: Hello! Could you expand your example for the a bit not-so-hapy java users like me, and describe how to compile and run your code? That would be awesom
  • Anuraj Pandey: Some one is mis-using my id..i got the notification of the above comment..however i havent posted the comment :(
  • Anuraj Pandey: if u have some kind of pdf/text of the material u removed..it will be highly appreciable if u help me..i have my first google intern telephonic interv

My Tweets

About Me

Journey so far…