Robinhood·Software Engineer·Onsite - Coding / Algorithms
- Implement an LRU cache with O(1) get and put operations using a doubly-linked list and hash map.
- Your LRU cache is shared across many concurrent clients. How do you reason about its behavior under high concurrency, and what locking strategy would you use?
- A malicious client keeps inserting unique keys to thrash the cache. How would you defend against that?
- How would you make the cache authorization-aware so that one user cannot read another user's cached data?
“I've done this problem enough times that the base implementation felt automatic.”