Amazon came to my campus in the last week of July 2017.
The online round was hosted on HackerEarth platform.
It had 2 coding questions and 20 MCQs.
- Given an unsorted array A, find the largest value of i-j such that A[i]>A[j].
- Given an unsorted array A and a number k, find the maximum sum sub string in the array such that its sum is divisible by k.
1 mark each and 0.25 negative mark.
Few MCQs were based on data Structures, algorithms, oops and Operating Systems, 1 or 2 from logical reasoning, networking and DBMS each.
Every interview round started with the cliche “tell me about yourself” and ended with “do you have any questions”.
- Given a log file with product id and corresponding customer id for the products searched on Amazon, you need to find the most viewed product at the end of the day. If a product is viewed multiple times by a single customer its view count is increased only by 1. The number of products is very large so sorting, heap or hashing of product Ids is not feasible.
Solution– Use Trie data structure. After 10 minutes of discussion, I could come up this.
Production level code for insert and search in a trie was required.
What if k max viewed products were required.
During my discussion, he also asked me to write a hashing function.
- Dfs of a graph.
- Dfs of a n array tree. (Code was required)
- Given a string s and a file with each word on a separate line, find all the words in the file which are anagrams of the string s. The interviewer asked me to tell all the possible solutions irrespective of the complexity. This continued for 10 min.
- Given a m*n matrix find the number of paths from (0,0) to (m-1,n-1), at every block we either move 1 step down or 1 step right. Print all paths for the above question. A dp solution was required.
Solution: GeeksforGeeks Link.
- Given a n*n matrix with distinct elements from 1 to n^2, find minimum number of bombs required to destroy all cells of the matrix. If we bomb a cell with value i, a cell with value i-1 if 4 adjacent to it will also be destroyed. (Code was required)
What if the numbers were not unique.
- Find majority element in an unsorted array.
- Find majority element in sorted array. (logN solution was required).
- Print the elements of a tree diagonally.
- Find shortest distance between two nodes of a tree where every node also has a pointer to its parent node and we can also directly jump from a node a to node b, where b is the mirror image of a and a and b belong to the two sub trees rooted at the root of the given tree. The mirror image may or may not exist.
- Find the time required to pass information from root to all the nodes of the tree.
The interviewer then asked me which other noncoding subjects do I like. I said OS.
So he asked me several basic questions on OS.
- Bdady anamoly.
- Page Fault.
- Multi processing
- Difference between threading and multiprocessing.
- Scheduling Algorithms.
The famous Amazon’s Bar Raiser Round
- My internship experiences.
- Detail discussion about my summer internship project.
- What is your favorite algorithm and why.
- Toughest thing you did in college.
- What are some leadership principles you learnt during your summer internship.
- What was the non technical thing you learnt at your internship.
This was a telephonic round and went on for 34 minutes.
I recommend every one to prepare from InterviewBit, Hackerearth CodeMonk, Hackerrank,
System design Interview Questions, https://ashayraut.wordpress.com/interview-preparation-best-100/ and geeksforgeeks.
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
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.