Amazon Interview Experience | Set 272 (On-Campus)

Round 1: (online in hackerrank)

20 MCQ questions based on outputs, OS, DBMS.

1. Print all possible words from phone digits

2. Given a matrix where elements are inserted as 1 to n in row 0, n+1 to 2n in row 1 and so on till n^2 and you traverse the matrix in spiral manner, find the kth number you will visit

    eg. n = 3
    matrix: 1 2 3
            4 5 6
        7 8 9
        k = 4, output: 6
        k = 6, output: 8 

Round 2: (F2F)
1. Given a boolean matrix find the row with maximum number of 1s

2. Given a pointer to a node of a tree, print the inorder successor. Assume that you have a function getParent(node) which returns the parent of the node

3. Given a array find the configuration where we will get max sum of i*array[i]
eg: 8312 = 8*0 + 3*1 + 1*2 + 2*3 = 11
3128 = 3*0 + 1*1 + 2*2 + 8*3 = 29
1283 = 1*0 + 2*1 + 8*2 + 3*3 = 27
2831 = 2*0 + 8*1 + 3*2 + 1*1 = 15
max value here is 29 when array is rotated by 1
expected time complexity O(n)
hint: see what goes out and what comes in when the array is rotated. You dont need to rotate the array

Some questions that my friends were asked:

1. Root to leaf path sum equal to a given number. Also print the path

2. Given a number n and a pattern that follows like: (1 to 26): a,b,c,….z (27 to 52): aa,ab,ac,…az (52 to 78): ba,bb,bc,…bz . . . za,zb,zc,…zz aaa,aab,aac,…aaz aba,abb,abc,… . . . find the nth pattern
3. Given a linked list like 1->2->3->4->5->6->7->8 modify it to 1->8->2->7->3->6->4->5

Round 3:(F2F)
1. part 1: Design the snake and ladder game. consider cases like there may be another ladder at the end of another ladder, or a snake at the end of another snake.
Mainly focus on the data structure you will use to design the game and all cases.

part 2: now that your game is designed, find the minimum number of dice throws/jumps you will have to make to reach the end i.e. 100 starting from 0
you can control the value that comes up when you throw a dice.

2. Explain heap sort, hipify, percolate_down, time complexity

Round 4:(F2F)
1. OS related questions like what is paging, page faults
DBMS: transactions, ACID property, primary indexing, secondary indexing, multilevel indexing

2. Given an array check if the array can be a preorder traversal of a BST
3. Design a data struct such that insert, delete, findMin(), find() can be done in O(1)

4. Diagonal view of a tree
similar to Diagonal Traversal of Binary Tree

5. Diameter of a Binary Tree

Round 5:(Telephonic round):
1. About my summer internship
2. OS, DBMS questions
3. Given an array, just make the B-tree of order 3
4. Design STL map
5. Given a tree, connect all siblings. Asked me to give both iterative as well as recursive approach

Thanks Geeksforgeeks.

Recruiter at amazon are very friendly. Interact with the interviewer if you get stuck. Try to come up to different approach to solve the same problem. Their main focus remains on how you see a problem and try to solve the problem. Don’t jump to code it as soon as you are given the problem, first discuss it then go for coding if asked. Be confident and don’t give up if you can’t get the perfect solution.

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.

Write your Interview Experience or mail it to

My Personal Notes arrow_drop_up
Article Tags :
Practice Tags :

Be the First to upvote.

Please write to us at to report any issue with the above content.