← Back to Course Index

Estimation Cheat Sheet

Latency numbers, power-of-two table, common benchmarks. Memorize these.

Ref
Source
Jeff Dean's "Latency Numbers Every Programmer Should Know" + Alex Xu, Ch 2

Originally compiled by Jeff Dean at Google. Updated for modern hardware.

Latency Numbers (2024 Hardware)

OperationLatencyScale
L1 cache reference1 nsinstant
L2 cache reference4 nsinstant
Main memory reference (RAM)100 nsinstant
SSD random read16 μsfast
Read 1 MB sequentially from memory3 μsfast
Read 1 MB sequentially from SSD49 μsfast
Read 1 MB sequentially from disk (HDD)825 μsokay
Round trip within same datacenter500 μsokay
Send packet CA → Netherlands → CA150 msslow

Visual Scale

L1 cache
1ns
L2 cache
4ns
RAM
100ns
SSD random read
16μs
Datacenter round-trip
500μs
HDD sequential 1MB
825μs
Cross-continent RTT
150ms
Key takeaway

Memory is 1000× faster than SSD, which is 1000× faster than cross-continent network calls. This is why caching works. This is why CDNs exist. This is why you put compute close to data.

Power of Two Table

PowerExact ValueApproxName
2101,024~1 Thousand1 KB
2201,048,576~1 Million1 MB
2301,073,741,824~1 Billion1 GB
2401,099,511,627,776~1 Trillion1 TB
250~1 Quadrillion1 PB

Availability Table

AvailabilityDowntime/YearDowntime/Day
99% (two nines)3.65 days14.4 min
99.9% (three nines)8.76 hours1.44 min
99.99% (four nines)52.6 minutes8.6 sec
99.999% (five nines)5.26 minutes864 ms

Common Estimation Formulas

QPS (Queries Per Second)

QPS = DAU × avg_queries_per_user / 86,400

Example: 100M DAU, 10 queries/user → 100M × 10 / 86,400 ≈ ~12,000 QPS

Peak QPS ≈ QPS × 2 to 5 (traffic is bursty)

Storage

Storage = daily_new_objects × avg_size × retention_days

Example: 10M new tweets/day × 300 bytes × 365 days × 5 years ≈ ~5.5 TB

Bandwidth

Bandwidth = QPS × avg_response_size

Example: 12K QPS × 1 KB response = ~12 MB/s

Number of Servers

Servers = peak_QPS / single_server_QPS

Rule of thumb: a single modern web server handles ~1,000–10,000 QPS depending on workload.

Quick Size References

WhatTypical Size
A tweet (text only)~300 bytes
A metadata record (DB row)~1 KB
A web page~100 KB
A compressed photo~200 KB
A high-res photo~2 MB
A 1-minute video (compressed)~10 MB
86,400seconds in a day
2.5 millionseconds in a month
🔢 Don't memorize every number. Memorize the orders of magnitude and the formulas. The interviewer cares that you can reason about scale, not that you know SSD latency to the microsecond.