Code RoomRead-through cache layer
MediumPrep Room Coding #3684

Read-through cache layer

System designDistributed systemsMid–Senior~40 min

Design a read-through cache layer sitting between an API tier and a primary database for a product-catalog service. Traffic: ~120K reads/sec, ~2K writes/sec (95% reads), data is ~80% read-mostly product records but ~20% has frequent price/inventory updates. Requirements: cache reads to cut DB load by 10x+, keep cached data fresh within seconds of a write, survive a cache-node failure without overwhelming the DB, and avoid serving wildly stale prices. p99 read latency target <15ms.

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:30 left
Estimate4:30 planned
Design13:30 planned
Deep dive10:30 planned
Failure7:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.