3 YOE, mid-level. After talking with the HM, there were two phone screens, and they were still pretty hard.
Coding 1
Design a rate limiter.
- Just one rule
- Multiple rules
- Is it thread-safe, and how would you make it thread-safe (lock)
- If the request handler throws an exception for a given request, that request shouldn't be counted
- Don't drop the other rate-limited requests — when there's spare capacity, allow the previously throttled requests to be processed. How would you design that (honestly I didn't really get this, doesn't seem like a rate limiter's job...)
- Any other hidden issues (out-of-order, etc.)
Coding 2
Given an n-ary tree.
- Compute its maximum depth
- Delete some nodes so the tree's depth doesn't exceed k — figure out which nodes to delete, minimizing the number removed
This exact problem has shown up on the forum before, and most people solve it with DP, but the interviewer flat out wouldn't let me use DP... I got stuck for a bit but eventually wrote something out, though I didn't have time to run the tests.
The day after the interview, on Saturday, I got an email saying not moving forward...
Discussion
Loading comments…