Skip to main content
TRACK A · SYSTEM DESIGN

System Design

Capacity sizing math, layer-by-layer architectural trade-offs, failure scenario evaluations, and architecture trade-off notes.

CLOCK
45:00
GIVEN CONSTRAINTS & SCALEOpen Full Interactive Guide
  • • 100M DAU · ~50 req/user/day · 3x peak (~175K peak QPS)
  • • 95% reads / 5% writes · ~1 KB average value · 2B working-set keys
  • • Target 95%+ hit rate · Ephemeral cache (DB is source of truth)
  • • Nodes: ~100 GB usable RAM and ~100K ops/sec each
STAGE 1 OF 4 · CAPACITY & CONSTRAINTS

Back-of-Envelope Sizing Gate

0/2 CORRECT

With 2B keys × 1 KB × RF=2 (4 TB) and ~175K peak QPS, what sizes the cache fleet?

Hint: Compare RAM nodes (4,000 GB / 100 GB) vs QPS nodes (175K / 100K).

At 175K peak QPS (95% reads) and 95% cache hit rate, roughly how many read QPS hit the Primary DB?

Hint: Reads ≈ 166K/s. Misses = 5% of reads.

STAGE 2 OF 4 · ARCHITECTURE DECISIONS

Commit Your Architecture Decisions

0/4 LAYERS DECIDED
LAYER 1 · SHARDING & ROUTINGHow do clients or proxies map keys to cache shards?
LAYER 2 · WRITE & INVALIDATION PATHHow should writes keep the cache fresh without stalling writes?
LAYER 3 · REPLICATION & FAILOVERHow do you survive a cache shard crashing mid-peak?
LAYER 4 · HOT-KEY & STAMPEDE DEFENSEHow do you defend against celebrity keys and synchronized TTL expiry?
STAGE 4 OF 4 · DEEP-DIVE TRADE-OFFS

Architecture Follow-Ups & Signal Cards

Jot your design notes before clicking Reveal to compare against Strong vs Weak vs Red-Flag architectural trade-offs.

FOLLOW-UP 1

Why delete the cache key on a DB write instead of updating the cache with the new value?

FOLLOW-UP 2

How do you even know a hot key is happening before a shard falls over?

FOLLOW-UP 3

OpenAI twist: How does this architecture change for an LLM inference KV-cache?