githubEdit

Capacity Estimation

Quick reference for back-of-envelope calculations in system design interviews

Powers of Two

Power
Exact Value
Approx
Bytes

10

1,024

1 thousand

1 KB

20

1,048,576

1 million

1 MB

30

1,073,741,824

1 billion

1 GB

40

1,099,511,627,776

1 trillion

1 TB

50

~10^15

1 quadrillion

1 PB

Time Conversions

1 second = 1,000 milliseconds (ms)
1 second = 1,000,000 microseconds (μs)
1 second = 1,000,000,000 nanoseconds (ns)

1 day = 24 hours = 86,400 seconds (~100K seconds)
1 month = 30 days = 2,592,000 seconds (~2.5M seconds)
1 year = 365 days = 31,536,000 seconds (~30M seconds)

QPS (Queries Per Second) Conversions

Requests/Period
QPS (Average)
Formula

1M/day

~12 QPS

1M / 86,400

10M/day

~120 QPS

10M / 86,400

100M/day

~1,200 QPS

100M / 86,400

1B/day

~12K QPS

1B / 86,400

10B/day

~120K QPS

10B / 86,400

100B/day

~1.2M QPS

100B / 86,400

Peak Traffic Rule: Peak QPS ≈ 2-3× average QPS (use 3× for safety)

Latency Numbers Every Engineer Should Know

Key Takeaways:

  • Memory is ~100× faster than disk

  • Network within datacenter: ~0.5ms

  • Cross-region network: ~50-150ms

  • SSD seek: ~150μs (100× faster than HDD)

Storage Size Estimates

Text Data

Data Type
Size

1 character (ASCII)

1 byte

1 character (UTF-8)

1-4 bytes (avg ~1.5 bytes)

Short tweet (140 chars)

~140 bytes

Small JSON object

~1 KB

Medium-sized image (JPEG)

~200 KB

High-res photo

~2-5 MB

1080p video (1 min)

~50-100 MB

4K video (1 min)

~300-400 MB

Database Record Estimates

Storage Calculation Template

Bandwidth Calculation

Cache Size Estimation (80/20 Rule)

CDN Bandwidth Calculation

Database Connection Pool Sizing

Availability Calculations (Nines)

Availability
Downtime/Year
Downtime/Month
Downtime/Week

90% (one nine)

36.5 days

3 days

16.8 hours

99% (two nines)

3.65 days

7.2 hours

1.68 hours

99.9% (three nines)

8.76 hours

43.8 min

10.1 min

99.99% (four nines)

52.56 min

4.38 min

1.01 min

99.999% (five nines)

5.26 min

26.3 sec

6.05 sec

Formula:

Replication & Partitioning

Replication Factor

Partitioning (Sharding)

Quick Estimation Examples

Example 1: URL Shortener

Example 2: Twitter Timeline

Example 3: Video Streaming (Netflix-like)

Cost Estimation (AWS Prices - Approximate)

Interview Tips

  1. Round aggressively: 86,400 → 100K, 1,000,000 → 1M

  2. Show your work: Write calculations on board

  3. State assumptions: "Assuming 3× peak traffic..."

  4. Use powers of 10: 1K, 1M, 1B, 1T

  5. Don't aim for precision: ±20% is fine

  6. Focus on magnitude: Order of magnitude matters, not exact numbers

Common Interview Mistakes

❌ Spending >5 minutes on calculations ❌ Getting bogged down in exact numbers ❌ Not stating assumptions clearly ❌ Forgetting replication factor ❌ Forgetting peak traffic (use 2-3× average) ❌ Not accounting for indexes (adds 50-100% storage)

✅ Quick, ballpark estimates ✅ Clear assumptions ✅ Round numbers ✅ Show scaling thinking

Last updated