I interviewed for amazon over 2 days, with two 1 hour interviews on either day. Each interview has 2-3 LP question to begin with, followed by a technical question. These are the technical questions that were asked:
- Design a basic text editor like notepad. (I did it using linked list, keeping track of cursor "node" and inserting and deleting as your would normally on a linked list)
- LRU cache - https://leetcode.com/problems/lru-cache/
- a) Reverse a linked list - https://leetcode.com/problems/reverse-linked-list/
b) Reverse a linked list given L (a starting point) and R (a end point) - https://leetcode.com/problems/reverse-linked-list-ii/
- Design dealing N cards to M players and pretty printing each hand in a sorted order
I wrote down some basic classes for it like a "CARD", "PLAYER", "GAME" and enum for "SUIT"
Pretty printing you basically convert 1,11,12,13 to A,J,Q,K (i m sure there are better ways to do it)
For sorting, it would be a custom comparator for the class "CARD". I explained it to him a bit but didnt actually code it as we ran out of time.
Got the offer and accepeted.