Skip to content

ONE QUESTION. YOUR REASONING.

Design a distributed cache

Design a distributed cache: clients set, get and delete keys with an expiry, and the cache evicts the least recently used keys when it is full.

System designInfrastructure and platformSenior

YOUR BRIEF

What to work through

Work through a distributed cache as a spoken system design interview. Start by clarifying the scope, sketch a working design and explain the trade-offs behind your choices.

  • Set, get and delete key-value pairs
  • Set an expiry time on each key
  • Evict the least recently used keys when memory is full

BEFORE YOU START

Constraints to discuss

  • Get and set answer in under 10 ms
  • Hold 1 TB of data
  • Serve 100,000 requests a second at peak
  • Highly available; eventual consistency is acceptable
Need a starting point?

Watch for these common gaps as you prepare:

  • Placing keys by hash mod N
  • Finding the LRU key by scanning or sorting timestamps
  • No plan for a hot key
  • Promising strong consistency across copies without its cost
  • Adding disk durability nobody asked for
Read: System design questions and who asks them

Why this question is in the collection

These sources connect the problem to company interview reports or preparation guides. They do not guarantee what a company will ask you.

KEEP GOING

Your next question

Storage, files and linksDesign BitlyInfrastructure and platformDesign a rate limiterInfrastructure and platformDesign an A/B testing platformInfrastructure and platformDesign an ad click aggregator
Browse the collection
01

Pick a question

Read the brief and choose what you want to work on.

02

Talk it through

Explain your thinking. Respond to follow-ups. Draw when a design needs it.

03

Find your next improvement

Use the feedback from your interview to decide what to practise next.