~learn.
Learn · tools · W00 · Part 3

Numbers playground.

Type an estimate the way you'd say it in an interview and get the worked answer: storage, bandwidth, QPS, servers. Below are the numbers the course teaches, each linked to the lesson it comes from.

01 · calculator

Estimate it

what can I type?

Numbers 50k · 1.5M · 4B (billion) · 3.5T · 1,000 · 1e9 · 20%

Maths × x * · / ÷ per · + − · ^ · ( ) · of (20% of 10 TB)

Data B KB MB GB TB PB (×1,000) · KiB MiB GiB (×1,024) · bit Kb Mb Gb

Rates QPS RPS /s · Mbps Gbps · MB/s · 100M/day · per day

Time ns µs ms s min h day week month (30 d) year (365 d)

Lines peak = 3 × avg · one step per line or ; · # comment · ans

Convert … in Gbps · … in TB/day · … in ms

Functions ceil floor round min max log(x, base) log2 sqrt

Words after a number are counts (200M users, 20 views/day) and multiply by 1. “4B” is 4 billion; “4 B” or “4 bytes” is bytes. “Mb” is megabits, “MB” megabytes.

interview presets
answer · data (decimal units, 1 KB = 1,000 B)
259.2 TB
bandwidth on the way · 100 MB/s = 800 Mbps
interview shortcut (1 day ≈ 10⁵ s): 300 TB
  • = 235.7 TiB in binary units (1 KiB = 1,024 B)
  • = 259,200,000,000,000 bytes
the lesson gets100 MB/s (800 Mbps) for 30 days ≈ 259 TBtaught in W00 · Part 3 · §2.3–2.4 →
worked solution
  1. read as: 50,000 /s × 2,000 B × 2,592,000 s50k QPS × 2 KB = 100 MB/s100 MB/s × 30 days = 259.2 TB→ 259.2 TBunits: 50k QPS = 50,000 /s · 2 KB = 2,000 B · 30 days = 2,592,000 s
Mini drill · 15 questions

Can you do it without the calculator?

Week 0's trial has a part just for estimation: RPS from daily volume, peak factors, storage with replication, bits vs bytes. Pass it with 80% for +100 XP. The lesson's own quick checks are a gentler warm-up.

02 · reference

Numbers every engineer should know

how long things take

Latency

The ratios matter more than the absolute values: memory is ~1,000× faster than SSD for random reads, and a cross-continent round trip costs 150 ms no matter how fast your code is.

Latency numbers every programmer should know
OperationTime
L1 cache reference0.5 ns
Branch mispredict5 ns
L2 cache reference7 ns
Mutex lock/unlock25 ns
Main memory reference100 ns
Compress 1 KB with Snappy3,000 ns (3 µs)
Send 1 KB over 1 Gbps network10,000 ns (10 µs)
Read 4 KB randomly from SSD150,000 ns (150 µs)
Read 1 MB sequentially from memory250,000 ns (250 µs)
Round trip within same datacenter500,000 ns (0.5 ms)
Read 1 MB sequentially from SSD1,000,000 ns (1 ms)
HDD seek10,000,000 ns (10 ms)
Read 1 MB sequentially from HDD20,000,000 ns (20 ms)
Send packet CA → Netherlands → CA150,000,000 ns (150 ms)

Popularised by Jeff Dean (circa 2009–2012; the SSD rows came in later versions). NVMe SSDs are faster today. Part 5 (operating systems) uses the same figures, with ranges whose faster end fits newer hardware: L1 ~0.5–1 ns, L2 ~4–7 ns, L3 ~10–20 ns, RAM ~100 ns, SSD ~100–150 µs, HDD ~10 ms. The 1 KB over 1 Gbps row is 8 µs of pure transmission; 10 µs rounds up for overhead.

Sources: Jeff Dean, “Numbers Everyone Should Know” ↗ · Colin Scott, interactive latency numbers by year ↗

Network round trips
PathLatency
Same datacenter (same rack)0.5 ms
Same datacenter (different rack)1 ms
Same region (different AZ)1–2 ms
Cross-region (same continent)20–50 ms
Cross-continent100–200 ms
Geostationary satellite600+ ms
NYC ↔ London, minimum RTT (light in fiber, ~200,000 km/s over ~5,500 km)~55 ms
1 MB on a 100 Mbps link (transmission delay)80 ms
1 MB on a 1 Gbps link (transmission delay)8 ms
Handshakes and lookups
StepCost
TCP handshake1 RTT (~0.5 ms in a DC; 20–50 ms cross-region; 100–200 ms cross-continent)
TLS 1.2 handshake (additional)2 RTT
TLS 1.3 handshake (additional)1 RTT
TLS 1.3 resumption0 RTT
DNS, cached locally< 1 ms
DNS, cached at resolver1–10 ms
DNS, full resolution50–200 ms
Inside one machine
OperationCost
Thread context switch~1–10 µs
Process context switch (incl. TLB/cache effects)~10–100 µs
Create a thread~10 µs
Create a process~0.1–1 ms
Minor page fault~1–10 µs
Major page fault~100 µs (SSD) · ~10 ms (HDD)
NUMA remote memory access~150–200 ns (local ~100 ns)
how much per second

Throughput

Network speeds are in bits, storage in bytes: divide Gbps by 8 for GB/s. Capacities per box are rules of thumb; real numbers depend on query complexity, data size, hardware and latency.

Network bandwidth
ConnectionSpeedData / second
Home broadband100 Mbps12.5 MB/s
Home fiber1 Gbps125 MB/s
AWS within an Availability Zone10–25 Gbps1–3 GB/s
Datacenter backbone100+ Gbps12+ GB/s

Formula: Gbps ÷ 8 = GB/s. Reading Gbps as GB/s overstates capacity 8×.

Disks
DeviceThroughput
HDD, sequential~100 MB/s
HDD, random~1 MB/s
SSD, sequential (1 MB in 1 ms, from the latency table)~1 GB/s
Memory, sequential (1 MB in 250 µs)~4 GB/s

The SSD and memory rows are worked out from the latency table (1 MB ÷ time), not separate measurements.

Databases (per node, approximate)
DatabaseOperations / second
PostgreSQL (single)10,000–50,000 queries/s
MySQL (single)10,000–50,000 queries/s
Redis (single)100,000+ ops/s
Cassandra (per node)10,000–50,000 writes/s
MongoDB (single)10,000–30,000 ops/s
DynamoDB (on-demand)Scales out (per-partition and account limits apply)
Sizing rule: DB capacity30,000 queries/s
Sizing rule: shard writes above10,000 writes/s on one primary
App servers (per server, approximate)
ServerRequests / second
Node.js (simple API)5,000–10,000
Go (simple API)30,000–50,000
Nginx (static files)50,000–100,000
Node.js (complex logic)1,000–3,000
Python/Django500–2,000
Sizing: simple API (CRUD)5,000–10,000 RPS per server
Sizing: complex logic1,000–3,000 RPS per server
Sizing: CPU-intensive100–500 RPS per server
Target utilisation70% (leave headroom)
Conservative default5,000 req/s per server
Kafka
RuleValue
Consumers in one group≤ partitions (12 partitions = max 12 consumers)
Parallelism= number of partitions
Replication3× (3 replicas per partition)
Per-partition write throughput (outside figure, measure yours)~10 MB/s

The course doesn't give a per-partition throughput. Confluent's sizing rule is partitions = max(T ÷ p, T ÷ c), with p and c the producer and consumer throughput you measure on one partition; ~10 MB/s is a common conservative starting point, not a guarantee.

Source: Confluent (Jun Rao), “How to choose the number of topics/partitions in a Kafka cluster?” ↗

how big things are

Sizes

When in doubt, estimate 1 KB per record. Media dominates storage: a 1 KB post with a 20% chance of a 500 KB image averages 100 KB.

Text and identifiers
ItemSize
Character (ASCII)1 byte
Character (UTF-8, average)1–4 bytes
UUID36 bytes (string) / 16 bytes (binary)
Timestamp (64-bit, e.g. PostgreSQL timestamp, Unix epoch ms)8 bytes
Email address~30 bytes
URL~100 bytes
Tweet (text + metadata)~300 bytes on average (~500 for a full 280 characters)
Typical JSON API response2–10 KB
Average email50–100 KB
Average web page (HTML + assets)2–3 MB

The timestamp row isn't in the course; it's from the PostgreSQL docs.

Source: PostgreSQL docs, date/time types (timestamp: 8 bytes) ↗

Database records (typical)
RecordSize
User profile (basic)500 bytes – 1 KB
Product listing1–5 KB
Order record500 bytes – 1 KB
Log entry200–500 bytes
Search index entry200 bytes
Session data1–2 KB
Rule of thumb1 KB per record
Media
ItemSize
Favicon~1 KB
Thumbnail image5–10 KB
Profile picture (small)50–100 KB
Regular photo (compressed)200 KB – 2 MB
High-res photo5–10 MB
1 min of video, 720p phone recording~50 MB
1 min of video, 1080p phone recording~60–100 MB
1 min of video, 4K phone recording~350 MB
1 min of streamed video, 1080p at ~3–5 Mbps~25–40 MB
1 min of audio (MP3)~1 MB
Video bitrates (stored per hour)
ResolutionPer hourBitrate
360p200 MB/hr~0.44 Mbps
720p500 MB/hr~1.1 Mbps
1080p1.5 GB/hr~3.3 Mbps

The per-hour sizes are the YouTube practice problem's givens; the bitrate column is worked out from them.

storage and time

Units

The course estimates in decimal units (1 KB = 1,000 B). Binary units (KiB, 1,024 B) are what RAM and some tools report; the gap grows to ~10% at TB.

Storage units
UnitDecimal (course convention)Binary
Kilobyte1 KB = 1,000 B (10³)1 KiB = 1,024 B (2¹⁰)
Megabyte1 MB = 1,000 KB (10⁶ B)1 MiB = 1,048,576 B (2²⁰)
Gigabyte1 GB = 1,000 MB (10⁹ B)1 GiB = 1,073,741,824 B (2³⁰)
Terabyte1 TB = 1,000 GB (10¹² B)1 TiB ≈ 1.1 × 10¹² B (2⁴⁰)
Petabyte1 PB = 1,000 TB (10¹⁵ B)1 PiB ≈ 1.13 × 10¹⁵ B (2⁵⁰)
Shortcut1 million KB = 1 GB · 1 billion KB = 1 TBevery 10 powers of 2 ≈ 3 powers of 10
Bits vs bytes1 byte = 8 bitsMB/s × 8 = Mbps

The lesson's powers-of-two table gives 2¹⁰ as 1 KiB ≈ 1 KB and then estimates with 1,000. This playground follows the same convention: KB/MB/GB are decimal and KiB/MiB/GiB are binary.

Seconds in…
PeriodSecondsRound to
1 minute6060
1 hour3,600~4,000
1 day86,400~100,000 (10⁵)
1 week604,800~600,000
1 month (30 days)2,592,000~2.5 million
1 year (365 days)31,536,000~30 million (3 × 10⁷)
X per day → per second÷ 86,400÷ 100,000
the estimation cheat sheet

Rules of thumb

State assumptions first, show the maths, round to nice numbers, then say what the number means for the design. Don't spend more than 5 minutes on it.

Traffic
RuleValue
Requests per seconddaily requests ÷ 86,400 (≈ ÷ 100,000)
Peak, normal apps2× average
Peak, social / viral3× average
Peak, flash sales / events5–10× average
Read:write, read-heavy (social media)100:1 to 1000:1
Read:write, mixed (e-commerce)10:1 to 100:1
Read:write, write-heavy (logging)1:1 to 1:10
DAU as a share of MAUusually 20–40%
E-commerce conversion rate1–3%
Storage, servers and caches
RuleValue
Storageobjects × size × retention × replication
Replication: databases3× (1 primary + 2 replicas)
Replication: object storage (S3)built in (already replicated)
Indexesadd 20–30%
Logsoften as large as the main data
Backupsoften 2–3× for backup retention
API serverspeak RPS ÷ 5,000 ÷ 0.7
DB read replicasread RPS ÷ 30,000
Cache sizehot data: 20% of total (80/20), or the last N hours/days
Cache hit rate to aim for90%+
Short codes: 62⁶ / 62⁷~56 billion / ~3.5 trillion

Every number here is copied from the lesson named under its table. If one ever disagrees with its lesson, the lesson is the source of truth. Data units follow the course: 1 KB = 1,000 bytes (decimal); KiB, MiB and GiB are the 1,024-based units.