2,000,000 QPS
Sustained peak request volume during high-traffic events.
Build a fault-tolerant, low-latency in-memory cache supporting LRU eviction and Raft replication.
Target production parameters expected in a senior or staff interview round.
Sustained peak request volume during high-traffic events.
Daily active users generating read and write operations.
Projected data ingestion and replication storage capacity.
Strict end-to-end percentile latency SLA constraint.
Establish clear problem boundaries before proposing architectural components.
Step-by-step arithmetic conversions for QPS, storage, and bandwidth.
| Dimension | Calculation Formula | Estimated Result |
|---|---|---|
| Throughput Capacity | 2,000,000 QPS across 50 cache nodes | ~40,000 QPS per node (Easily within single-thread memory bounds) |
| Data Sharding Space | 500 GB cache capacity ÷ 50 nodes | 10 GB memory per shard node with 2x replicas |
How requests navigate ingress gateways, application logic, caching, and persistence.
Hashes keys to determine the target cache shard without querying a centralized coordinator.
Executes O(1) lookups and evictions in memory with non-blocking read locks.
Monitors node liveness and triggers replica promotion within 500ms of node failure.
Entity models, indexing, and primary key partitioning.
Synchronized across client SDKs via gossip broadcasts.
How to defend engineering compromises when challenged by interviewers.
Rationale: Client-side routing chosen for sub-millisecond execution in high-throughput internal microservices.
Rationale: LRU with 2-Q segmented queue handles both burst scans and steady-state read workloads.
Key interview questions and conceptual defenses.
By assigning 256 virtual tokens on the hash circle per physical machine, keys distribute uniformly across physical nodes, minimizing variance from 30% to under 2%.