When traffic spikes expose hidden coupling, memorize key anchors ($1\text{ day} \approx 86{,}400\text{ s} \approx 10^5\text{ s}$, $1\text{ KB} = 2^{10}$, L1 cache $\approx 1\text{ ns}$, RAM $\approx 100\text{ ns}$, NVMe SSD $\approx 100\text{ }\mu\text{s}$, cross-continent RTT $\approx 150\text{ ms}$) to sanity-check architectures before writing code.
TL;DR30-second simplified summary▾
In system design interviews and production capacity reviews, a 60-second back-of-the-envelope calculation immediately tells you whether a dataset fits in single-node RAM (Redis), requires SSD-backed sharding.
Memorize key anchors (, , L1 cache , RAM , NVMe SSD $\approx 100\text{.
The idea & core mechanics.
Why this matters: Size QPS, storage, memory, and network bandwidth in seconds using powers-of-two byte units and Jeff Dean's latency numbers every engineer should know.
In system design interviews and production capacity reviews, a 60-second back-of-the-envelope calculation immediately tells you whether a dataset fits in single-node RAM (Redis), requires SSD-backed sharding, or saturates a 10 Gbps NIC.
| Choice | What it buys | What it costs |
|---|---|---|
| Good candidate | First 5 minutes of any system design interview to establish QPS, peak QPS (2–3x average), 5-year storage, and cache RAM. | |
| Good candidate | Production architecture reviews to verify network egress, IOPS, and memory budgets. | |
| Think twice | Spending 15 minutes doing exact arithmetic in an interview—round aggressively to powers of 10 and powers of 2. |
Principle 1
Powers of 2: , , , , .
Principle 2
Time shortcuts: ; ; .
Principle 3
Latency ladder: L1 cache (~1 ns) < RAM (~100 ns) < 1 Gbps LAN (~500 us) < NVMe SSD random read (~100 us) < HDD seek (~10 ms) < Cross-continent packet (~150 ms).
Principle 4
80-20 rule for caching: caching the hottest 20% of daily traffic in RAM typically serves ~80% of reads.
Walkthrough & implementation.
Step-by-step execution mechanics and reference implementation for Back-of-the-Envelope Estimation.
Architecture & Trade-Off Matrix
| Operation | Approx. Latency | Relative Scale |
|---|---|---|
| L1 Cache Reference | ~1 ns | 1x |
| Main Memory (RAM) Reference | ~100 ns | 100x |
| Compress 1 KB with LZ4/Snappy | ~3 us | 3,000x |
| NVMe SSD Random Read (4 KB) | ~100 us | 100,000x |
| Same-AZ / Datacenter Round-Trip | ~500 us (0.5 ms) | 500,000x |
| HDD Seek | ~10 ms | 10,000,000x |
| US West -> Europe Round-Trip | ~150 ms | 150,000,000x |
Reference Implementations (Python & Java)
# Quick QPS, Peak QPS, and 5-year Storage Estimator (Python)
def estimate_system(dau: int, reqs_per_user_day: int, bytes_per_write: int, write_ratio: float = 0.1):
avg_qps = (dau * reqs_per_user_day) / 86_400
peak_qps = avg_qps * 3
daily_write_bytes = dau * reqs_per_user_day * write_ratio * bytes_per_write
five_year_tb = (daily_write_bytes * 365 * 5) / (1024 ** 4)
return {"avg_qps": round(avg_qps, 1), "peak_qps": round(peak_qps, 1), "storage_5yr_tb": round(five_year_tb, 2)}
// Quick QPS and 5-year Storage Estimator (Java)
public static Map<String, Double> estimate(long dau, int reqsPerDay, int bytesPerWrite, double writeRatio) {
double avgQps = (dau * (double) reqsPerDay) / 86_400.0;
double peakQps = avgQps * 3.0;
double dailyBytes = dau * (double) reqsPerDay * writeRatio * bytesPerWrite;
double fiveYearTb = (dailyBytes * 365.0 * 5.0) / Math.pow(1024, 4);
return Map.of("avgQps", avgQps, "peakQps", peakQps, "storage5YrTb", fiveYearTb);
}