Position: SDE1 at Amazon
Date: 7 March, 2020
There were two coding questions:
1. One based on standard BFS in a matrix
2. Based on priority queue something similar to k Order statistics
Virtual Onsite Interviews:
1.There are two types of chocolates Milk chocolate and Dark chocolate and N rows of such chocolates. You are given some number X(milk chocolate) and Y(dark chocolate) that is the number of chocolates you have to complete . You have to find what is the maximum number of rows you can cover? (Sorry, if the description is not clear but in the interview I was given this description only, I’ll try to clear it with help of some examples).
Note: Order of chocolates is not important.
Example 1: M M D D
D M M
As we can cover either row 1 and row 2 or row 2 and row 3 but not all the rows.
Example 2: D D
D M M
As we can cover only row 2.
Example 3: M M D D
D M M
As we can cover all the rows.
2. You are given a linked list and a number k. You have to sort the linked list in groups of size k by the sum value of each individual chunk in decreasing order. The elements within a chunk will not change.
Linked List: 1->3->0->5->1->7->0->2->4->3
So, the chunk 1->7 has sum 8 which is the highest so it will be placed first. Then chunk 4->3 with sum 7 after it and so on.
Round 3: With Senior Technical Program Manager
Role in current company sort of questions.
Little discussion about projects.
What is caching?
OOPS questions like inheritance, problems faced in inheritance, diamond problem and virtual keyword.
Design LRU cache ( only approach was discussed, no need to code).
Coding question: careercup.com/question?id=5717962873896960
Round 4: Senior Manager
Detailed discussion about projects and current role. Lots of behavioural questions based on LP.
What is caching? Types of caching algorithm.
Design LRU cache. Extended it a little bit how you will handle if more than one thread try to insert value in cache at the same time. Also, should know whatever STL containers you are using how they are implemented. I was asked how is list implemented in C++ (doubly linked list or singly linked list not too much depth).
After a week around I got the call that I am selected :). Thanks GeeksForGeeks!
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course. In case you are prepared, test your skills using TCS, Wipro, Amazon and Microsoft Test Serieses.