githubEdit

Numbers to Know

Critical reference for system design interviews - memorize these!

Latency Numbers (2024)

Memory & Storage Hierarchy

Operation
Latency
Notes

L1 cache reference

0.5 ns

1 CPU cycle

Branch mispredict

5 ns

Pipeline flush

L2 cache reference

7 ns

14× L1

Mutex lock/unlock

25 ns

Context switch overhead

Main memory (RAM) reference

100 ns

200× L1, fundamental unit

Compress 1KB with Snappy

3 μs

3,000 ns

Send 2KB over 1 Gbps network

20 μs

Same datacenter

Read 1MB sequentially from memory

250 μs

~4 GB/sec throughput

Round trip in same datacenter

500 μs

0.5 ms

Read 1MB from SSD

1 ms

4× faster than HDD

Disk seek (HDD)

10 ms

Random access

Read 1MB sequentially from disk

20 ms

Sequential 10× faster

Send packet CA → Netherlands → CA

150 ms

Cross-continental

Key Takeaways

Rules of Thumb:

  • Memory is ~100,000× faster than disk

  • SSD is ~100× faster than HDD

  • Sequential access is ~10× faster than random

  • Same-datacenter network: <1ms

  • Cross-region network: 50-150ms


Throughput Numbers

Network Bandwidth

Connection
Bandwidth
Real Throughput

4G LTE

100 Mbps

~12 MB/sec

Home Internet

100-1000 Mbps

12-125 MB/sec

Datacenter NIC

10 Gbps

~1.25 GB/sec

High-end NIC

100 Gbps

~12.5 GB/sec

Storage Throughput

Storage Type
Sequential Read
Random IOPS

HDD

100-200 MB/sec

100-200 IOPS

SATA SSD

500-600 MB/sec

90K IOPS

NVMe SSD

3-7 GB/sec

500K-1M IOPS

Memory (RAM)

20-100 GB/sec

N/A


Time Conversions (for QPS calculations)

Quick Conversion Formula:


Storage Sizes

Powers of 2 & 10

Power
Exact (2^n)
Approximate (10^n)
Name

2^10

1,024

~1 thousand

KB

2^20

1,048,576

~1 million

MB

2^30

1,073,741,824

~1 billion

GB

2^40

1,099,511,627,776

~1 trillion

TB

2^50

~1,125,899,906,842,624

~1 quadrillion

PB

Data Sizes

Database Record Sizes


Availability (Nines)

Availability
Downtime/Year
Downtime/Month
Downtime/Day

90% (1 nine)

36.5 days

3 days

2.4 hours

99% (2 nines)

3.65 days

7.2 hours

14.4 min

99.9% (3 nines)

8.76 hours

43.8 min

1.44 min

99.95%

4.38 hours

21.9 min

43.2 sec

99.99% (4 nines)

52.6 min

4.38 min

8.64 sec

99.999% (5 nines)

5.26 min

26.3 sec

0.86 sec

99.9999% (6 nines)

31.5 sec

2.63 sec

0.09 sec

Formula:


Typical System Scales

Small Startup (0-10K users)

Medium Startup (10K-1M users)

Large Scale (1M-100M users)

Massive Scale (100M+ users)


Cost Estimates (AWS - Approximate 2024)

Compute (EC2)

Instance Type
vCPU
RAM
Cost/Month

t3.micro

2

1 GB

$7

t3.small

2

2 GB

$15

t3.medium

2

4 GB

$30

t3.large

2

8 GB

$60

m5.large

2

8 GB

$70

m5.xlarge

4

16 GB

$140

m5.2xlarge

8

32 GB

$280

c5.large (CPU optimized)

2

4 GB

$62

Storage

Storage Type
Cost

EBS (SSD)

$0.10/GB/month

EBS (HDD)

$0.045/GB/month

S3 Standard

$0.023/GB/month

S3 Glacier (archive)

$0.004/GB/month

Database

Service
Cost

RDS db.t3.micro

$15/month + storage

RDS db.m5.large

$120/month + storage

DynamoDB

$0.25/GB/month + $1.25 per million writes

ElastiCache (Redis) t3.micro

$12/month

Network

Service
Cost

Data Transfer OUT

$0.09/GB (first 10 TB)

Data Transfer IN

Free

CloudFront (CDN)

$0.085/GB

Load Balancer (ALB)

$16/month + $0.008/LCU-hour

Example: Twitter-like App (1M DAU)


Interview Quick Reference

Memorize These 10 Numbers

  1. L1 cache: 0.5 ns (fastest)

  2. RAM: 100 ns

  3. SSD: 1 ms (1,000 μs)

  4. HDD seek: 10 ms

  5. Network (same DC): 0.5 ms

  6. Network (cross-region): 150 ms

  7. 1M requests/day ≈ 12 QPS

  8. 99.9% availability = 8.76 hours downtime/year

  9. Rule of thumb: Peak traffic = 3× average

  10. Index overhead: Add 50-100% to storage

Quick Calculation Template


Practice Problems

Use these numbers to quickly estimate:

Q: 100M users, each generates 5MB data. Storage needed with 3× replication?

Q: System handles 10B requests/day. What's the QPS?

Q: If 99.99% availability is required, max downtime/month?

Last updated