Cache with single-flight
Design a concurrent cache with single-flight (dogpile / thundering-herd prevention) in front of an expensive backend (e.g. a 300ms recommendation computation) serving 100k req/sec across many app servers. Constraints: when a hot key expires, the backend must be called once, not by every concurrent miss, stale-but-fast responses are acceptable briefly, and a slow recompute must not cascade into backend overload. Describe the cache layout, how concurrent misses for the same key are coordinated, and the recompute path.
What a strong answer looks like
Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts (data model, bottlenecks, consistency, failure modes) and name the trade-offs you are making.
Clarify4:00 left
Estimate4:00 planned
Design11:30 planned
Deep dive9:30 planned
Failure6:00 planned
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.
Run or narrate your approach, then ask the coach.