Amazon New Grad 2021 | Reject | 3 roundx45 | Location US, Seattle
Anonymous User
923

Cleared all Test cases in OA1 and OA2 (No of islands, Fetch items to display), last was usual work style sim.
Interview 1: OOD - Implement UNIX Find command, specifically interested in the implementation of the matching criteria and actions, For example find /root/ "extension is java and size>=400"
Follow up: How would you add new matching criteria without much modifiction in the existing code, say new criteria is timestamp.
Parsed the expression using regular BNF parser logic with "is", ">","or" having higher precendence over "and", for matching criteria logic quickly wrote some working code, then discussed on applying oops principles similar to this https://leetcode.com/problems/design-an-expression-tree-with-evaluate-function/discuss/910018/C%2B%2BPython-The-Intended-Solution-During-The-Interview-Polymorphism, then was asked how would I add new rule so I suggested to use Builder pattern so I could create any new rule object based on the arguments.
Interview 2: SQL vs NoSQL, Eventual Consistency
Find a cycle in a m x n grid, from point 0,0 you could go left, right, top and bottom if it has the same value (similar to No of islands) but the variant is you have to look for a cycle
Started with top sort approach by keeping visited and visiting set but realised it wouldn't work and interview as well pointed it out(as it wasn't directed), then went ahead with critical connections in a network approach where we rank the node while performing dfs and try to find the back edge, interviewer was fine with this but was keen on simplifying it so gave me a hint to use the parent node, and I was eventually was able to come with the logic and code it but had a goof up where I forgot to return if cycle was found in it's childrens and didn't get much time to do a dry run to fix it. and interviewer had to point it out to me as well.
Interview 3: zigzag binary tree traversal (coded this quickly and did a dry run), then was asked LRU cache (discussed the approach with LinkedHashMap and Double LinkedList and map and all the methods) then asked to discuss about AVL trees, tc of generic data structures

All the LP questions were from Amazon leadership post on leetcode discuss.

Comments (5)