Back-of-Envelope Estimation Cheatsheet

Quick reference for system design interview calculations. Memorize these numbers!

🔢 Power of 2 & Units

PowerExact ValueApproxBytesExample
101,0241 thousand1 KBSmall text file
201,048,5761 million1 MBPhoto
301,073,741,8241 billion1 GBMovie
401,099,511,627,7761 trillion1 TBData warehouse
501,125,899,906,842,6241 quadrillion1 PBLarge datacenter

Quick conversions:

  • 1 byte = 8 bits
  • 1 KB = 1,000 bytes (or 1,024 for precise)
  • 1 MB = 1,000 KB = 1,000,000 bytes
  • 1 GB = 1,000 MB = 1,000,000,000 bytes (1 billion)
  • 1 TB = 1,000 GB = 1,000,000,000,000 bytes (1 trillion)
  • 1 PB = 1,000 TB

Tip: For quick math, use 1000 instead of 1024. Close enough for interviews!

⏱️ Latency Numbers (2024)

OperationLatencyComparison
L1 cache reference0.5 ns
L2 cache reference7 ns14x L1 cache
Main memory reference100 ns20x L2 cache
Send 1KB over 1 Gbps network10 μs (10,000 ns)
Read 1 MB sequentially from memory250 μs
Round trip within datacenter500 μs (0.5 ms)
Read 1 MB sequentially from SSD1 ms4x memory
Disk seek10 ms20x SSD
Read 1 MB sequentially from disk30 ms30x SSD
Send packet CA→Netherlands→CA150 ms

Key Takeaways:

  • Memory is fast: ~100 ns
  • SSD is okay: ~1 ms for 1 MB
  • Disk is slow: ~10-30 ms
  • Network within datacenter: ~0.5 ms RTT
  • Cross-continent: ~150 ms

Mnemonic: “My Silly Dog Needs Treats”

  • Memory (100 ns)
  • SSD (1 ms)
  • Disk (10 ms)
  • Network datacenter (0.5 ms)
  • Transcontinental (150 ms)

📊 Common System Numbers

Availability

AvailabilityDowntime/YearDowntime/MonthDowntime/WeekDowntime/Day
99% (two nines)3.65 days7.2 hours1.68 hours14.4 min
99.9% (three nines)8.7 hours43.8 min10.1 min1.44 min
99.99% (four nines)52.6 min4.38 min1.01 min8.64 sec
99.999% (five nines)5.26 min26.3 sec6.05 sec864 ms

Quick formula:

Downtime/year = (1 - availability) × 365 days × 24 hours

Example: 99.9% = 0.001 × 365 × 24 = 8.76 hours/year

QPS (Queries Per Second)

Conversion factors:

  • 1 day = 24 hours = 86,400 seconds ≈ 100K seconds (easy math!)
  • 1 month ≈ 2.5 million seconds
  • 1 year ≈ 30 million seconds

Examples:

100 million requests/day = 100M / 100K = 1,000 QPS
1 billion requests/day = 1B / 100K = 10,000 QPS
10 billion requests/day = 10B / 100K = 100,000 QPS

Peak QPS: Assume 2-3x average for peak times

Average: 10K QPS
Peak: 20-30K QPS

Storage

Typical data sizes:

  • Tweet (text only): 280 bytes
  • Tweet (with metadata): ~1 KB
  • Small image: 200 KB
  • High-res photo: 2-5 MB
  • 1 min video (720p): ~10 MB
  • 1 min video (1080p): ~20-50 MB
  • 1 min video (4K): ~100-200 MB

User-generated content:

Assumptions:
- 100M DAU
- Each user posts 1 photo/day
- Each photo = 2 MB

Storage/day = 100M × 2 MB = 200 TB/day
Storage/year = 200 TB × 365 ≈ 73 PB/year

Bandwidth

Formula: Bandwidth = Data Size / Time

Upload 10 TB/day:
= 10 TB / 86,400 sec
= 10 × 10^12 bytes / 86,400 sec
≈ 115 MB/sec

If read:write ratio is 10:1:
Read bandwidth = 115 MB/s × 10 = 1.15 GB/s

Network bandwidth capacity:

  • 1 Gbps = 125 MB/s
  • 10 Gbps = 1.25 GB/s
  • 100 Gbps = 12.5 GB/s

🧮 Estimation Template

1. Traffic Estimation

Given: 100 million DAU

Step 1: Requests per user per day
- Assume average user makes 10 requests/day

Step 2: Total daily requests
- 100M users × 10 requests = 1 billion requests/day

Step 3: QPS (average)
- 1B / 86,400 sec ≈ 1B / 100K = 10K QPS

Step 4: Peak QPS
- Peak = Average × 2-3
- Peak = 10K × 2 = 20K QPS

2. Storage Estimation

Given:
- 100M DAU
- 10M posts/day
- Each post = 1 KB metadata + 1 MB media (average)

Step 1: Daily storage
- Posts: 10M × 1 KB = 10 GB
- Media: 10M × 1 MB = 10 TB
- Total: ~10 TB/day

Step 2: Yearly storage
- 10 TB/day × 365 = 3,650 TB ≈ 3.6 PB/year

Step 3: With replication (3x)
- 3.6 PB × 3 = 10.8 PB/year

3. Bandwidth Estimation

Given: 10 TB written per day, read:write = 10:1

Step 1: Write bandwidth
- 10 TB/day / 86,400 sec
- = 10 × 10^12 bytes / 86,400
- ≈ 115 MB/sec

Step 2: Read bandwidth
- 115 MB/s × 10 = 1,150 MB/s ≈ 1.15 GB/s

Step 3: Peak bandwidth (2x)
- Write: 230 MB/s
- Read: 2.3 GB/s

4. Memory/Cache Estimation

Given:
- 10K QPS
- 80% cache hit rate desired
- Average response = 1 KB

Step 1: Requests hitting cache
- 10K × 0.8 = 8K requests/sec from cache

Step 2: Unique requests (assume 20% are unique)
- 8K × 0.2 = 1.6K unique items/sec

Step 3: Daily unique items
- 1.6K × 86,400 = 138M items/day

Step 4: Cache size (keep 1 day)
- 138M × 1 KB = 138 GB
- Add 20% buffer = 166 GB
- Round up to 200 GB cache

📝 Common Calculation Patterns

Pattern 1: DAU to QPS

DAU → Actions/User → Total Actions → QPS
100M → 10 actions → 1B actions → 10K QPS

Pattern 2: QPS to Server Count

Assumptions:
- QPS needed: 10K
- Each server handles: 1K QPS
- Redundancy factor: 2 (for failures)

Servers = (10K / 1K) × 2 = 20 servers

Pattern 3: Storage Growth

Current: 1 PB
Growth: 20% per year
5-year projection: 1 × 1.2^5 ≈ 2.5 PB

Pattern 4: Cache Hit Rate Impact

Without cache:
- All requests to DB: 10K QPS

With 90% cache hit rate:
- Cache: 9K QPS
- DB: 1K QPS (10x reduction!)

🎯 Interview Tips

Quick Approximations

Use round numbers:

  • 100 million → 10
  • 1 day → 100K seconds (instead of 86,400)
  • 1 year → 30M seconds (instead of 31.5M)

Scientific notation:

Instead of: 1,000,000,000
Write: 10^9 or 1B

Break down complex calculations:

Bad: "100M × 10 × 365 / 86,400 = ?"

Good:
- Daily: 100M × 10 = 1B
- Yearly: 1B × 365 ≈ 365B ≈ 400B
- Per second: 400B / (365 × 86,400) ≈ 10K

Common Mistakes to Avoid

Being too precise: Don’t calculate 86,400 exactly, use 100K
Forgetting peak traffic: Always mention 2-3x for peaks
Ignoring replication: Storage usually needs 3x for redundancy
Not stating assumptions: Always say “assuming X…”
Giving single number: Give range: “10-20K QPS”

Round up: Safety margin is good
State assumptions clearly: “Assuming 100M DAU…”
Show your work: Don’t just state the answer
Sanity check: Does 10 PB/day make sense?

Practice Problems

Problem 1: Design Instagram

  • 500M DAU
  • 50M photos/day
  • Each photo: 2 MB
  • Read:write ratio: 100:1

Calculate: QPS, storage/year, bandwidth

Problem 2: Design Twitter

  • 300M DAU
  • 200M tweets/day
  • Each tweet: 280 bytes + metadata
  • Timeline: 100 requests/user/day

Calculate: Tweet QPS, timeline QPS, storage

Problem 3: Design YouTube

  • 1B DAU
  • 500M video uploads/day
  • Each video: 100 MB average
  • Watch:upload ratio: 1000:1

Calculate: Upload QPS, storage/year, bandwidth

📋 Cheat Sheet Summary

Memorize These:

  1. Time:

    • 1 day = 100K seconds (close enough)
    • 1 year = 30M seconds
  2. Units:

    • KB (thousand), MB (million), GB (billion), TB (trillion), PB (quadrillion)
  3. Latency:

    • Memory: 100 ns
    • SSD: 1 ms
    • Disk: 10 ms
    • Network (datacenter): 0.5 ms
    • Network (cross-region): 150 ms
  4. Availability:

    • 99.9% = 8.7 hours/year downtime
    • 99.99% = 52 minutes/year downtime
  5. Typical Assumptions:

    • Peak = 2-3x average
    • Cache hit rate = 80-90%
    • Replication factor = 3
    • Read:write ratio = 10:1 to 100:1

💰 Cost Estimation (Industry Pricing)

Why cost matters in interviews: Shows you understand business trade-offs, not just technical solutions. Mentioning costs demonstrates maturity and real-world thinking.

When to discuss costs: Always in “Wrap up” phase (Step 4 of framework). Also when justifying design decisions (e.g., “We use S3 because it’s cheaper than database storage”).

Cloud Provider Pricing (2024)

Primary reference: AWS (most common in interviews)
Alternatives: GCP (~10-20% cheaper), Azure (similar to AWS)

Live pricing links (always check for latest):

1. Compute Costs (Servers)

AWS EC2 Pricing (US East region, on-demand):

Instance TypevCPURAMCost/HourCost/MonthUse Case
t3.micro21 GB$0.01$7.30Dev/test, very small apps
t3.small22 GB$0.02$14.60Small web servers
t3.medium24 GB$0.04$29.20Standard web servers
t3.large28 GB$0.08$58.40Medium workloads
m5.large28 GB$0.10$73.00General purpose
m5.xlarge416 GB$0.19$138.70High traffic web servers
m5.2xlarge832 GB$0.38$277.40Heavy workloads
c5.large24 GB$0.09$65.70CPU intensive
r5.large216 GB$0.13$94.90Memory intensive (cache)

Quick estimates:

  • Small web server: $15-30/month (t3.small)
  • Standard web server: $75-150/month (m5.large)
  • Database server: $100-300/month (r5.large - r5.xlarge)

Cost saving tip: Reserved Instances (1-3 year commitment) = 40-60% discount

  • t3.medium on-demand: $29/month
  • t3.medium reserved (1 year): $18/month (38% savings)

Interview calculation:

Need: 20 web servers for 100K QPS
Instance: m5.xlarge ($138/month each)
Total: 20 × $138 = $2,760/month for compute

2. Storage Costs

2.1 Object Storage (S3)

AWS S3 Pricing (Standard tier):

  • Storage: **23 per TB/month)
  • PUT requests: $0.005 per 1000 requests
  • GET requests: $0.0004 per 1000 requests

Quick estimates:

  • 1 TB storage: $23/month
  • 10 TB storage: $230/month
  • 100 TB storage: $2,300/month
  • 1 PB storage: $23,000/month

S3 tiers (for cost optimization):

  • S3 Standard: $0.023/GB (frequent access)
  • S3 Infrequent Access: $0.0125/GB (monthly access)
  • S3 Glacier: $0.004/GB (archival, rare access)

Interview calculation:

Instagram example:
- 1 billion photos/day × 2 MB = 2 PB/day
- Monthly storage: 2 PB × 30 days = 60 PB
- Cost: 60 PB × $23,000/PB = $1.38M/month (ouch!)
- With lifecycle (move old to Glacier): ~$500K/month

2.2 Database Storage

AWS RDS (PostgreSQL/MySQL):

  • Storage: $0.115 per GB/month (General Purpose SSD)
  • High Performance SSD: $0.23 per GB/month
  • Instance costs: Same as EC2 + 30% markup

Example:

  • db.m5.large: $116/month (instance)
  • 500 GB storage: $58/month
  • Total: $174/month

AWS DynamoDB (NoSQL):

  • On-demand: 0.25 per million reads
  • Provisioned: $0.00065 per write capacity unit/hour
  • Storage: $0.25 per GB/month

Quick rule: Database storage is 5x more expensive than object storage (S3).

3. Network/Bandwidth Costs

AWS Data Transfer Pricing:

  • Inbound: FREE (data coming into AWS)
  • Outbound (first 10 TB/month):
    • To Internet: $0.09 per GB
    • Between regions: $0.02 per GB
    • Within same region: FREE (mostly)

Expensive! Bandwidth is often a hidden cost.

Interview calculation:

Twitter example (read-heavy):
- 25 billion timeline views/day
- Average 100 KB per view = 2.5 PB/day
- Monthly outbound: 2.5 PB × 30 = 75 PB
- Cost: 75,000 TB × $0.09/GB = 75M GB × $0.09 = $6.75M/month!

Solution: Use CDN (much cheaper)

4. CDN Costs

AWS CloudFront Pricing:

  • $0.085 per GB for first 10 TB/month
  • $0.080 per GB for next 40 TB/month
  • $0.060 per GB for next 100 TB/month
  • $0.040 per GB for next 350 TB/month
  • $0.030 per GB for over 500 TB/month

Much cheaper than direct bandwidth!

Cloudflare Pricing (alternative):

  • Free tier: Unlimited bandwidth (!)
  • Pro: $20/month
  • Business: $200/month

Interview calculation:

Twitter with CDN:
- 75 PB/month outbound
- CDN cost: 75,000 TB × $0.03/GB (bulk rate) = 75M GB × $0.03 = $2.25M/month
- Savings vs direct: $6.75M - $2.25M = $4.5M/month saved!
- CDN is 3x cheaper + faster for users

5. Cache/Redis Costs

AWS ElastiCache (Redis):

InstanceRAMCost/HourCost/MonthUse Case
cache.t3.micro0.5 GB$0.017$12.40Dev/test
cache.t3.small1.5 GB$0.034$24.80Small cache
cache.m5.large6.4 GB$0.147$107.00Standard
cache.m5.xlarge12.9 GB$0.294$214.00Medium
cache.r5.large13.5 GB$0.188$137.00Memory-optimized
cache.r5.xlarge27 GB$0.376$274.00Large cache

Quick estimate: 100 GB Redis cache ≈ $800-1,000/month

6. Load Balancer

AWS Application Load Balancer (ALB):

  • Fixed: 16.40/month**
  • Per GB processed: $0.008/GB
  • Cheap! Usually $20-50/month total

7. Message Queue

AWS SQS Pricing:

  • First 1 million requests/month: FREE
  • $0.40 per million requests after that
  • Very cheap for most use cases

Example: 100 million messages/month = $40/month

8. API Gateway

AWS API Gateway:

  • $3.50 per million requests
  • $0.09/GB data transfer

Example: 10 million API calls/month = $35/month

Cost Estimation Formula

Total Monthly Cost =
  Compute (servers) +
  Storage (database + object storage) +
  Network (bandwidth + CDN) +
  Cache (Redis) +
  Other (load balancer, message queue, etc.)

💡 Cost Estimation Examples

Example 1: URL Shortener (Small Scale)

Assumptions:

  • 1 million URLs shortened/month
  • 10 million redirects/month (10:1 read ratio)
  • 500 bytes per URL
  • Keep URLs for 5 years

Costs:

Compute:
- 2 web servers (t3.medium): 2 × $29 = $58/month
- 1 database server (db.t3.small): $26/month

Storage:
- URLs: 1M/month × 12 months × 5 years = 60M URLs
- Size: 60M × 500 bytes = 30 GB
- RDS storage: 30 GB × $0.115 = $3.45/month

Bandwidth:
- 10M redirects × 1 KB = 10 GB/month
- Cost: 10 GB × $0.09 = $0.90/month

Other:
- Load balancer: $16/month
- Redis cache (cache.t3.small): $25/month

Total: $58 + $26 + $3.45 + $0.90 + $16 + $25 = $129/month
Or ~$1,550/year

Cost per URL shortened: 0.000129** (fraction of a cent)

Example 2: Instagram (Large Scale)

Assumptions (from earlier):

  • 500M DAU
  • 1 billion photos/day
  • 2 MB per photo
  • 25 billion photo views/day

Costs:

Compute:
- 500 web servers (m5.xlarge): 500 × $138 = $69,000/month
- 50 database servers (r5.2xlarge): 50 × $547 = $27,350/month

Storage:
- Photos: 1B/day × 30 days = 30B photos/month
- Size: 30B × 2 MB = 60 PB/month (cumulative)
- S3 cost: 60 PB × $23,000/PB = $1.38M/month
- With Glacier for old photos: ~$500K/month

Bandwidth/CDN:
- 25B views/day × 2 MB = 50 PB/day
- Monthly: 50 PB × 30 = 1,500 PB = 1.5 EB
- CDN cost: 1.5M TB × $0.03/GB = 45M/month (!!!)

Cache:
- 100 TB Redis: ~$80K/month

Other:
- Load balancers: 50 × $16 = $800/month
- Databases (RDS): Included in compute above

Total: $69K + $27K + $500K + $45M + $80K = ~$46M/month
Or ~$550M/year

Reality check: Instagram (owned by Meta) likely spends more with custom infrastructure, but this gives the ballpark.

Example 3: Twitter (Medium Scale)

Assumptions:

  • 300M DAU
  • 600M tweets/day
  • 500 bytes per tweet
  • 25 billion timeline views/day

Costs:

Compute:
- 200 web servers (m5.xlarge): 200 × $138 = $27,600/month
- 30 database servers (r5.xlarge): 30 × $274 = $8,220/month

Storage:
- Tweets: 600M/day × 30 days × 12 months = 216B tweets/year
- Size: 216B × 500 bytes = 108 TB/year
- Database storage: 108 TB × $0.115 × 12 months = $149K/year
- S3 for media: ~$300K/month

Bandwidth/CDN:
- 25B timeline loads/day × 50 KB average = 1.25 PB/day
- Monthly: 1.25 PB × 30 = 37.5 PB
- CDN: 37,500 TB × $0.04/GB = $1.5M/month

Cache:
- 300 GB Redis: ~$2,500/month

Message Queue (Kafka):
- 20 servers (m5.large): 20 × $73 = $1,460/month

Total: $27.6K + $8.2K + $300K + $1.5M + $2.5K + $1.5K = ~$1.84M/month
Or ~$22M/year

📊 Cost Optimization Tips (Mention in Interviews!)

  1. Use Reserved Instances: 40-60% discount for 1-3 year commitment
  2. Auto-scaling: Scale down during off-peak (save 30-50%)
  3. CDN for bandwidth: 3-5x cheaper than direct bandwidth
  4. S3 Lifecycle policies: Move old data to Glacier (5x cheaper)
  5. Spot Instances: 70-90% discount for non-critical workloads
  6. Right-size instances: Don’t over-provision (monitor and adjust)
  7. Multi-region carefully: Cross-region transfer is expensive
  8. Compress data: Reduce bandwidth and storage costs
  9. Cache aggressively: Reduce database load (fewer expensive servers)
  10. Choose right database: DynamoDB vs RDS based on workload

🎯 How to Use Costs in Interviews

Step 1: Calculate Technical Requirements First

  • QPS, storage, bandwidth (like we did earlier)

Step 2: Estimate Costs in Wrap-Up

“Let’s estimate monthly costs for this design…”

Compute: 50 servers × $100 = $5,000
Storage: 10 TB × $23 = $230
Bandwidth/CDN: 100 TB × $0.04 = $4,000
Cache: $1,000
Total: ~$10,000/month or $120K/year

Step 3: Discuss Trade-offs

  • “We could reduce costs by 40% using Reserved Instances”
  • “CDN adds 2K)”
  • “At this scale, costs are manageable. At 10x scale, we’d need cost optimization”

Step 4: Show Business Sense

  • “For a startup with 100K users, $10K/month is reasonable”
  • “For 10M users, 1”
  • “We should monitor cost per user and optimize if it exceeds $X”

🔢 Quick Cost Reference (Memorize!)

Compute: 25/TB/month (S3), 90/TB direct, 100-200/month per 10 GB Redis
Load Balancer: 100-500/month
Medium system (100K users): 500K-2M/month

📝 Cost Estimation Template

System: [Name]
Scale: [Users, QPS, Data size]

Compute:
- Web servers: [X] × $[Y] = $[Z]/month
- Database servers: [X] × $[Y] = $[Z]/month

Storage:
- Database: [X] TB × $115 = $[Z]/month
- Object storage: [X] TB × $23 = $[Z]/month

Network:
- CDN: [X] TB × $40 = $[Z]/month

Cache:
- Redis: [X] GB → $[Z]/month

Other:
- Load balancer: $20/month
- Message queue: $50/month

Total: $[Z]/month or $[Z]/year

Cost per user: $[Total] / [Users] = $[Z]/user/month

Practice makes perfect! Do 2-3 calculations daily for different systems. Always add cost estimation in interview wrap-up!


Last Updated: 2026-04-09