Pattern

Caching

Trade a bounded amount of staleness for a large drop in read latency and load on the system of record.

What it is

Caching means serving a read from a fast, bounded copy of data instead of recomputing or refetching it from the system of record, accepting that the copy may occasionally be stale or absent. In a system design interview this is rarely "add a cache" as an afterthought — it's a specific decision about what to precompute versus compute on read, how long an entry stays valid, what happens to callers on a miss, and how the cache is kept from serving something both wrong and expensive to detect. The interesting design work is usually not the cache itself but the pipeline that keeps it warm: what triggers a write into it, and what a reader does when the entry isn't there.

When it applies

Tells in the problem

The classic mistake

Treating the cache as if it were the source of truth once it's warm, and forgetting to design what happens on a miss or after an invalidation — a design that only describes the cache-hit path leaves the interviewer to ask "what happens on a cold cache, or when this entry expires, or when the underlying data changes before the TTL is up," and a candidate without an answer has actually only designed half the system. The fix is to always narrate the miss path (recompute from the system of record, populate the cache, return) and the invalidation path (what event or TTL removes or refreshes an entry) as part of the same design as the hit path, not as an afterthought once asked.

Questions to start with

All 3 caching questions

Problem statement, examples and hints are free on every page; the worked approach, solution and tests are in the company guides.

Free starter pack

13 must-tier questions with full solutions

Sign in with an email — no purchase — and read them in the full reader.

No password, no spam. One sign-in email; you can read the pack in the full reader.