Round 1: Phone Screen
Questions:
-
Basic calculator: Basic Calculator II
This was an easier version with only addition and multiplication. Solved it with constant space. -
Wordbreak: Word Break
I used bottom up DP to solve this.
Round 2: Onsite
Questions:
-
System Design: Design Facebook messenger. There'd only be messages between individuals, no groups.
Was able to write the API and design and a few deep dives, but stumbled on a few things. Think this is why I didn’t get an offer. -
Behavioral Questions: Standard behavioral questions. Only I remember are:
- A time you made a mistake
- Your favorite project
- Worst co-worker you’ve worked with
Could have prepared better for this.
-
Coding 1:
- Max sum path: Binary Tree Maximum Path Sum
Solved it recursively. - Maximum swap: Maximum Swap
Solved it with n space. I used Java for this question which I feel like was a bad idea. Getting syntax right under pressure was harder than I would have thought.
- Max sum path: Binary Tree Maximum Path Sum
-
Coding 2:
- Maximum number of edges between two nodes in a binary search tree: Specific question not provided.
Solved recursively. - Pick random citizen of a city: Random Pick with Weight
Solved with n space and used binary search to select the proper city. He asked a follow-up question about using an int rather than a long.
- Maximum number of edges between two nodes in a binary search tree: Specific question not provided.
Candidate's Approach
- For the basic calculator, I implemented a solution that handled only addition and multiplication with constant space.
- For the word break problem, I utilized a bottom-up dynamic programming approach.
- In the system design round, I was able to articulate the API and design but faced challenges in some areas.
- I solved the max sum path recursively and used a space-efficient method for the maximum swap problem.
- For the random pick problem, I implemented a solution using binary search to optimize the selection process.
Interviewer's Feedback
No feedback provided.