Open In App

Amazon Interview | Set 19

I recently had a set of interviews with Amazon.com and listing below the questions. The day had around 15-20 of us at their office and the whole process took close to 12 hrs.

Hope, people can reap benefit from it. 🙂



1st Round: Online Written round.
a. Determine if a matrix is a cross-matrix.
    A cross-matrix is a one in which all the diagonal elements are same and not repeated anywhere else.
b. Print the level-order in reverse order, i.e. from Bottom to top.
c. One more easy question, which I don’t remember now.

2nd Round: F2F- Developer
a. Kadane’s Algo.
However, it was hidden behind a good problem set.
Interviewer wanted to identify whether I can recognize the same.
I did not remember it instantly but was able to prove it by solving.
b. Linked-list intersection point.
Again, had to decipher the above from a different problem set.
[A tree with only parent pointer, how to find LCA?]
Was able to easily identify the same and we quickly moved onto other things.



3rd Round : Hiring Manager
a. Design a stack which can perform findMax in O(1).
Had read the answer once in some book and duly told him have heard it.
He verified and we moved on.
b. Set of stocks for each day have been given. Need to find the days on which I buy and sell share to earn max profit, alongwith finding the max profit.
Had to write the code, which I was able to do well.
He was impressed and I felt I had a good chance.

4th Round : Developer
a. Find top k searched elements from a continuous stream of data.
I remember we needed to use Min Heap but his constraint was using a continuous stream.
Finally was able to do it with his help.
b. Some design question based upon his team’s problems.
Had to use a queue and a hashmap to solve it.
He was very much interested in whether I could identify the complexities correctly.

5th Round : Manager – Different Team
a. Given a linked-list and 2 integers k & m. Reverse the linked-list till k elements and then traverse till m elements and repeat.
Write production quality code.
I am not sure what happened and why I fell off on such an easy question, but you just can do something like that in the last round.
b. An array of elements have been given. Find for each element, first max element to its right.
Was able to do it well, however lost it on complexity analysis.
c. Boundary traversal of a tree. Write the code.
Wrote the code, however he was not able to check the same as took a lot of time.




 

Before this round, I had good hope of getting selected, but no one can give such a bad last interview and get selected and hence after 2 weeks got a rejection mail.

 

This article is compiled by Mohit.

Article Tags :