Amazon Interview Experience | Set 203 (On-Campus for SDE-1)
Hi everyone. Following is my experience of the recent Amazon recruit drive:
Aptitude Round: (1:30 hours)
MCQs on outputs, maths, algorithms, DBMS, OS.
2 Coding questions: ( on hackerRank)
- Given 2 strings, check if any one of them has any anagram of the other string, as a substring of it.
- Graph question : ( not mentioned directly as graph, but was implied). basically Needed to find the shortest path between two given vertices in the graph.
Tip: It is important that one should attempt both sections decently.
- On a number line from negative infinite to positive infinite, if you start from 0, you can either jump back or front. but every jump length is 1 more than the previous jump. Given a number on the number line, can we reach it using any combination of jumps. If yes, print the minimum length path.
- Boolean Matrix Problem
- Row with max 1s
- You have n slabs with two dimensions. Stack them to get max height. No rotation of dimensions required. First he started with 2 dimensions, then 3, 4 and then for n dimensions.
- Given a binary tree, a target node in the binary tree, and an integer value k, delete all the nodes that are at distance k from the given target node. No parent pointers are available.
- An array of 0s and 1s is given. A sequence is given as f(1)=1,f(2)=2, f(n)=f(n-1)^2 – f(n-2)^2.
Print 0s and 1s alternatively according to the given sequence.
- Implement the power function in log n complexity.
- Intersection of two arrays
- Given a stream of As and Bs, print 1 when no of As is odd and no of Bs is even. I just had to draw the DFA for it.
- An SQL query.
- Given an array and a window k, print the minimum in every window of k. After suggesting a few data structures like dequeue, heap, bst, he told me to code it using bst.
- A file system is given. All the subdirectories in the root directory, the subdirectories within subdirectories and so on is given. The input is some file or subdirectory paths for which we need permission. Find the minimum permissions required to get all the permissions. No file for which permission is not asked should be given permission to.
- The interviewers are really very helpful and they keep on giving hints if you are stuck. Just let them continuously know your thought process. It is not necessary that you speak continuously but let them know what you think in intervals.
- They might ask you to think of better complexities and different data structures to solve the same problem. But its not that if you straight away land up in an optimized solution its bad for you because I was asked sometimes to compromise on the complexity but think of other data structures to solve it.
- While coding take your time. Make sure you cover the corner cases and if it is taking long, let your interviewer know what you are doing currently. Test it before finally approving it. If it fails, don’t worry, tell your interviewer about it and think of a fix or an alternative
Finally, a big big thanks to GeeksForGeeks for being a wonderful resource.
If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Hey geek! It’s time to become a success story instead of reading them. Check out our most renowned DSA Self Paced Course, now at a student-friendly price and become industry ready. And if you are looking for a more complete interview preparation resource, check out Complete Interview Preparation Course that will prepare you for the SDE role of your dreams!
Feeling prepared enough for your interview? Test your skills with our Test Series that will help you prepare for top companies like Amazon, Microsoft, TCS, Wipro, Google and many more!My Personal Notes arrow_drop_up