Limited-time offer: 80% off every plan

See plans

Narrate a Distributed Cache System Design Interview

A 35-minute, narrated walkthrough for a distributed cache system design interview: scope the requirements, sketch the architecture, pick a strategy and defend the trade-offs.

By Emily Miller11 min read

The interviewer is not checking whether you can name a cache product. They are checking whether you can turn a vague ask into scoped requirements, draw an architecture you can explain, and defend each choice when they push back. The way to do that is to narrate the design as a sequence of decisions: every box comes with a reason, a rejected alternative and a trade-off you can state out loud. This distributed cache system design interview walkthrough gives you that sequence, a 35-minute time budget and the wording to use.

What does the interviewer actually want from a distributed cache design?

Four things are being scored, and they are scored in this order:

  • Requirement gathering. Can you turn "design a distributed cache" into specific numbers before you draw?
  • Architecture reasoning. Can you explain what each layer does and why it exists?
  • Trade-off defence. Can you name the cost of your choice before the interviewer does?
  • Follow-up handling. Can you extend the design when a probe exposes a gap, without restarting?

A useful time budget for a 35-minute slot:

  1. 5 minutes: requirements. Ask, then write your assumptions on the board.
  2. 5 minutes: high-level sketch. Client, cache tier, backing store, and the arrows between them.
  3. 15 minutes: deep dive. Strategy, eviction, partitioning, hot keys.
  4. 5 minutes: trade-offs. Say what you gave up and when you would revisit it.
  5. 5 minutes: follow-ups. Answer by extending the design, not repeating it.

The budget matters because running out of time reads as poor prioritisation. If you finish the deep dive early, spend the slack on failure modes, not on more boxes.

Step 1: Turn "design a distributed cache" into system design requirements

Start with a short script of clarifying questions:

"Before I draw, let me pin down four things: what are we caching, what is the read-to-write ratio, how stale can a read be, and what scale are we designing for?"

Then state a worked assumption set and write it on the board:

  • What: a product catalogue, read-heavy.
  • Load: 50k reads/sec, 5k writes/sec.
  • Working set: 100 GB.
  • Latency target: 10 ms p99 for cache hits.

Say the non-functional requirements explicitly: latency target, availability expectation, how much staleness is tolerable, and what should happen when the cache is full. Stating these before drawing is a habit worth building across every system design question; the same approach appears in our consistency models walkthrough.

The interviewer's reason for wanting this: an unscoped design cannot be judged. Numbers give them something to probe, which is exactly what you want, because you have already thought about them.

Step 2: Sketch the distributed cache architecture out loud

Draw the request path first: client → cache tier → backing store. Label the read flow as cache-aside on the arrows so the diagram explains itself.

Then name the three layers you are adding:

  1. Access layer. A client-side library or a proxy that knows which node holds a key.
  2. Cache nodes. The processes that hold the data in memory.
  3. Coordination layer. Membership and routing, so nodes can join, leave and be found.

Say why you are not putting the cache inside the application process: memory pressure on app instances, and an inconsistent view of the cache across instances. That single sentence shows you considered the simpler option and rejected it for a reason.

When you explain how keys map to nodes, keep it brief and use the vocabulary from our data partitioning guide. The interviewer usually wants to hear that you know why naive modulo hashing breaks when a node leaves, not a proof.

Step 3: Choose a cache strategy and say what you rejected

Put the four common strategies side by side and name the failure mode of each.

StrategyRead pathWrite pathMain failure mode
Cache-asideApp reads cache, on miss reads store and fillsApp writes store, then deletes keyStale data if the delete fails
Read-throughCache fetches from store on missApp writes storeMiss path becomes a dependency on the cache layer
Write-throughApp writes cache, cache writes storeSynchronous to storeWrite latency tied to the store
Write-behindApp writes cache, cache flushes laterAsynchronous to storeData loss if the cache dies before flush

For the catalogue, pick cache-aside: staleness is tolerable and the store stays the source of truth. Then give the invalidation plan: a TTL plus an explicit delete on write, and what happens if the delete fails, which is that readers see stale data until the TTL expires.

Say the trade-off out loud:

"I accept up to 60 seconds of stale data to keep write latency low. If the product team needed instant visibility on price changes, I would move price to write-through and leave descriptions on cache-aside."

That sentence does the work the interviewer is listening for: a choice, a cost, and the condition that would change it.

Step 4: Handle what interviewers always probe: eviction, hot keys and consistency

Eviction

Explain LRU, LFU and TTL-only in one line each, then pick one tied to your assumed access pattern. For a catalogue where popular items are read repeatedly, LFU or a TTL-plus-LRU hybrid is defensible; say which and why.

Hot keys

Describe the problem first: one shard saturates because a single key gets a large share of traffic. Then give two mitigations: replicate the key across nodes with a random suffix, and put a small local cache in front of the hot path.

Consistency

State your model plainly: eventual, bounded by the TTL. Then describe what a reader sees during a failed invalidation, which is the old value until expiry. If you want firmer language for defending a model, see our guide to picking and defending consistency models.

Failure modes

Cover node loss, cache stampede and invalidation failure in a sentence each. Naming them before you are asked signals that you design for operations, not just for the happy path.

Step 5: Name the system design trade-offs before you are asked

Use a short script: "The cost of this choice is X; I would revisit it if Y changed." Then apply it to three trade-offs:

  • Cache size vs hit rate. More memory raises the hit rate but costs more; I would size to the working set and watch the miss rate.
  • Replication vs consistency. Replicas improve availability and read throughput but make invalidation harder to keep in step.
  • TTL length vs freshness. Longer TTLs raise the hit rate and widen the staleness window.

When asked "what would you change at 10x scale", give one structural change, not a list. For example: "I would shard the cache tier by key range and add a second replica per shard, because the bottleneck moves from memory to per-node throughput." One change with a reason beats five hedged suggestions.

A full worked walkthrough: 35 minutes of distributed cache design, narrated

A condensed example of how the conversation can sound. The candidate's sentences are quoted.

Candidate: "Before I draw, let me pin down four things: what are we caching, what is the read-to-write ratio, how stale can a read be, and what scale are we designing for?"

Interviewer: "Product catalogue, read-heavy, staleness of a minute is fine, large scale."

Candidate: "I'll assume 50k reads/sec, 5k writes/sec, a 100 GB working set and a 10 ms p99 target, and write those on the board."

Pause and summarise: "So the requirements are a read-heavy catalogue, bounded staleness and a latency target. I'll sketch the request path first."

Candidate: "Client to cache tier to backing store, cache-aside on reads. I'm not putting the cache in the app process because of memory pressure and inconsistent views across instances."

Summarise before the deep dive: "That's the high-level shape. I'll spend the next block on strategy and eviction."

Interviewer: "Why not write-through for everything?"

Candidate: "Write latency would be tied to the store on every write, and the catalogue tolerates a minute of staleness. I'd keep write-through for price if freshness mattered more there."

Change of mind after a follow-up: "Good point on invalidation failures. I said TTL plus delete on write; if the delete can fail silently, I'd add a short TTL on price keys specifically so the worst case is bounded. That's a change from what I said earlier."

That last line is the model for changing your mind cleanly: name the change, give the reason, and move on without apologising for the earlier version.

The three mistakes that sink a distributed cache answer

  • Jumping to a product name before requirements. Weak: "I'd use Redis." Stronger: "I'd scope the requirements first, then choose a strategy; the product choice follows from the access pattern."
  • Drawing boxes without saying what they cost. Weak: "Here's the cache tier." Stronger: "This tier adds a network hop on every read; it pays for itself because the store can't take 50k reads/sec."
  • Ignoring failure modes. Weak: "The cache just expires keys." Stronger: "On node loss, routing sends keys to the next node and the hit rate dips while it refills; a stampede is the risk I'd guard against with request coalescing."

Each stronger version gives the interviewer a reason to nod instead of a reason to probe.

How to practise this walkthrough before the interview

  • 20-minute solo drill. Whiteboard the design and record yourself narrating it. Listen back for the moments you drew a box without a reason or skipped a trade-off.
  • Follow-up drill. Have a peer ask the Step 4 questions in random order: eviction, hot keys, consistency, node loss, stampede.
  • Review checklist. Did you state assumptions with numbers, name at least one rejected alternative, and summarise before the deep dive?

For the follow-up drill, the technique in our guide to responding to follow-up questions is to extend the design rather than repeat it. Practise that out loud; it is a spoken skill, not a reading one.

Before you walk in

The distributed cache system design interview rewards a narrated sequence of decisions, not a memorised diagram. Pick one assumption set, rehearse the four clarifying questions, and practise saying the cost of your main choice in a single sentence. Do that once with a recorder on, and you will hear your own gaps before the interviewer does.

Frequently asked questions

Should I mention a specific cache product in the distributed cache system design interview, or stay product-agnostic?

Stay product-agnostic until the requirements are on the board, then you can name a product as an example of a strategy. Naming one first suggests you are pattern-matching rather than reasoning. If you do mention one, tie it to a property you need, such as in-memory storage with TTL support, and move on.

How much detail on consistent hashing is enough before the interviewer moves on?

Enough to explain why it helps: when a node leaves, only its neighbours' keys move, instead of most keys being remapped. One or two sentences plus the failure it prevents is usually sufficient. Offer more only if the interviewer asks about virtual nodes or load balance.

What if the interviewer asks about cache stampede and I have not prepared for it?

Describe the problem in plain terms: many requests miss the same key at once and hit the backing store together. Then give one mitigation, such as letting a single request refill the key while others wait or serve stale data briefly. Admitting you would look up the details is fine; the reasoning is what is being scored.

Is it okay to change my design mid-interview when a follow-up exposes a flaw?

Yes, and saying so cleanly is better than defending a weak choice. Name the change, give the reason the follow-up revealed, and state the new trade-off. Interviewers usually read a clean revision as strong reasoning rather than as a mistake.

How do I keep the answer short enough to finish in 35 minutes?

Work to the time budget and summarise at each transition. Say what you have decided, what you are doing next, and check with the interviewer before the deep dive. Summaries take seconds and stop you from over-explaining one layer while leaving the trade-offs unsaid.

Practise the walkthrough out loud, then review where your trade-offs went unsaid.