Code RoomDependency-tracked cache invalidation
HardPrep Room Coding #3441

Dependency-tracked cache invalidation

System designDatabases & SQLDistributed systemsSenior–Staff~45 min

Design dependency-tracked cache invalidation for a GraphQL/API layer where a single cached response is derived from many underlying entities (a user's dashboard caches data from 12 different objects). When any underlying entity changes, exactly the cached responses that depend on it must be invalidated — no more, no less. Over-invalidation kills hit rate; under-invalidation serves stale data. Design how you track dependencies between cached responses and source entities at scale (millions of cached responses), and the trade-offs of the tracking granularity.

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.

Clarify5:00 left
Estimate5:00 planned
Design15:00 planned
Deep dive12:00 planned
Failure8:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.