The HR got my profile through Naukri, and sent me the link for test in July end.
There were 2 questions : Dont remember the exact questions, but one was based on graph, and second was based on priority queue. I solved one completly and 2nd one only few testcases passed.
got a call from the HR, and he scheduled 2 round later that week Both the rounds were coding rounds.
round 1 : Q-1) given directory path in linux in String like "/a/b/../c/d/../e/", how to get the absolute path. output => "/a/c/e/". approach I used was double linked list, can also be solved using stack.
Q-2) https://leetcode.com/problems/capacity-to-ship-packages-within-d-days/ --> I felt bad as I was not able to get the approach at that moment, which can be solved using binary search for O(nlogn)
round-2 : Q-1) generate a tree from given inorder and preorder array.
Q-2) given a string with some repetitions of character, print the string if non of the same character are consecutive.
example : input -> "aabbcc" output => "abcabc"
example : input -> "aaabaccbaa" => no such string possible.
first we had the discussion for the approach, I initialy thought of sorting the array based on one having maximum count and then rearranging, but interviewer was not happy, then i told another approch by using priority queue and then she was happy with it, but time was less and I was not able to write the complete code.
Both interviews were of approximate 1hrs.
I got the mail next day saying that I was not selected for further rounds.
This was the first time I appeared for amazon and I got the taste of it and I feel first 2 rounds can be easily cracked if i would have practiced more.
For my interview and my 2 friends interview experience(1 selected) I came to know they focus on these topics :
priority queue(asked by all three of us), tree questions(by all three of us, medium level on leet code), sliding window, stack and linked list. I m not saying to practice on these only but these are must do i would say.
I hope you find this useful somehow.