Demo case file · Technical
Mid-size SaaS company
Senior Backend Engineer
This is a demo case file: a realistic example written from commonly known interview formats, not a real candidate's interview experience.
Questions asked
- Implement an LRU cache with O(1) get and put.
- Now make it safe to use from multiple threads at once. What are the trade-offs of your locking approach?
- Add a per-key time-to-live so entries expire. How do you avoid scanning the whole cache to find expired keys?
What to expect
One problem that kept growing in three stages, all in a shared editor with code that had to run. The interviewer cared about clean interfaces and tests more than speed. For the concurrency part they wanted me to compare one big lock against finer-grained locking and say when each is good enough.
Practice this exact interview.
Mockd plays the interviewer live, using these questions and notes, then grades your answers.
Start a practice session Browse all case files