I had this opportunity to have interview with Amazon with the help of my friends, who referred me for SDE position.
Immediately after my friends’ reply that he has given my resume with a recruiter and I may get a call from recruiter, I got a call from some person with my interview schedule.
With a lapse of half an hour after schedule, my first interview started.
The interviewer was humble supportive one. After introductions, he straight away asked me questions one after another.
- Implement a stack with push, pull and findmin in O(1) time.
- There is an array of positive random integers. All the elements are repeated twice except for one. Find that element.
- Wap to stitch all the leaf nodes of a binary tree together. After stitching, the tree becomes a graph, and the stitched elements be stored in a list. Return the head node of the list.
I could quickly answer the first two ones, but had trouble writing working code for the third one. After several minutes passed. And my code messed up, I was asked to leave it. And the phone interview concluded.
With a gap of one hour, I had a second telephonic interview.
This time I was asked only two questions.
They were :
- Wap. There is a circular singly linked list, All elements are in ascending order. Insert a given number at its correct place in the list. The number is a random one.
- There is a stair case, at each step, a person can either take two steps or one step. What is the total number of steps?
With the guilt of being unable to do the previous interview coding properly, here, I directly wrote the implementation part of the linked list, without even checking my implementation was a mere singly linked list and not a circular one. Also, missed the syntax errors like a semi-colon(;) at end of struct declaration, etc. And after correcting me for those mistakes, or rather blunders, the interviewer moved onto second question, and I was trying to solve it mathematically and come out with a polynomial expression, while the interviewer intended me to derive a recursive function out of it. After failing with it, the interviewer advised me to follow codechef, topcoder kind of websites and to do more practice.
Hours after interview, I received a mail saying, I am not offered a job/no call for further interview.
I can reapply in 6 months.
Waiting for my second turn now, and practicing for it.