Open In App
Related Articles

Amazon Interview Experience | Set 357 (For 2.5 Years Experienced)

Improve Article
Save Article
Like Article

Some time back I went through an interview for for SDE-1 role, and here is my experience to help other aspirants :

Written – Pen & Paper Rounds
Had to write production level code in any programming language of my choice, covering all the edge cases, and clearly mentioning the complexity of my code.

  1. Lowest common ancestor in Binary search tree
  2. Remove minimum number of characters so that two strings become anagram
  3. Given an array, print the Next Just Greater Element for every element. The Next just greater Element for an element x is the just greater element on the right side of x in array. Return the same element if there is no greater element present on right side, or if same element is present again on right side (in case of duplicates)
    For e.g. given input array : 3,5,8,4,2,6,3
    output should be : 3,6,8,6,3,6,6

    Solution: GeeksforGeeks Link
    Solved it using Binary search tree

Face to Face Rounds?
Interviewers were very very helpful, and were focused on approach, they will ask basic brute force solution first, then an optimum solution, after that they may increase the complexity of problem a little bit, and if you are able to explain your approach satisfactorily, then will ask you to write production level code in any programming language of your choice, covering all edge cases using pen and paper :

  1. Find an element in an unsorted array such that all left elements are smaller and all right elements are greater.
    Solution: GeeksforGeeks Link
    O(n) time complexity solution is required.
  2. Find kth smallest element in row wise column wise sorted matrix. Discussed both min heap and max heap approach with complexity of both.
    Solution: GeeksforGeeks Link
  3. What if there are duplicate elements in matrix, and we have to consider all duplicate element as one position, i.e. if matrix contains elements like 3,6,4,3,5,4,7 then
    1st smallest element is 3
    2nd smallest element is 4
    3rd smallest element is 5
    4th smallest element is 6, irrespective of there occurrence
    I asked if I can use hashing, but he was looking something with less space complexity, was not able to answer this particular thing further.
  4. Level order traversal in spiral form
  5. Find the maximum difference between any combination of child and parent node in a given binary tree. Here child node can be any level below parent node, but should be in the same sub tree starting from parent node. solved using recursion, bottom up approach, returning the maximum difference and minimum node value till current node, to upper node at every level.
    Solution: GeeksforGeeks Link
  6. Detailed discussion about project, something new which I have designed, why this, why not this etc, how my team work, complete process, my individual role, responsibility and contribution. Do you have bugs in code, how you correct. Have any bug from your code reached production. What you do outside of work, do you have any open source contribution, etc.
  7. Given any two nodes in a binary tree, find the path from 1st node to another, and tell if the path is a straight line, or there are turns on the line, find number of turns.
    Solution: GeeksforGeeks Link
  8. Detailed discussion about java hashmap, hashset, its internal working and its complexity.
  9. Lots of behavioural questions like, most complex thing done, how you did it, what challenges you faced, negative feedback you received, how you improved, and many more cross questions.

Advice to fellow members preparing for something like Amazon :

  1. first get good understanding of basic data structure concepts, can refer section wise or any book like Narasimha Karamunchi (I referred this book), don’t just read, but implement things.
  2. Read book like Cracking The Coding Interview to learn how to answer behavioural questions. These questions are very limited, but are must for amazon.
  3. Practice and solve last 40 amazon interview experience from

I hope this information will be helpful to all of you, wish you all the very very best.

If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated : 10 Jul, 2019
Like Article
Save Article
Similar Reads
Complete Tutorials