Back-of-Envelope Estimation Cheatsheet
Quick reference for system design interview calculations. Memorize these numbers!
🔢 Power of 2 & Units
| Power | Exact Value | Approx | Bytes | Example |
|---|---|---|---|---|
| 10 | 1,024 | 1 thousand | 1 KB | Small text file |
| 20 | 1,048,576 | 1 million | 1 MB | Photo |
| 30 | 1,073,741,824 | 1 billion | 1 GB | Movie |
| 40 | 1,099,511,627,776 | 1 trillion | 1 TB | Data warehouse |
| 50 | 1,125,899,906,842,624 | 1 quadrillion | 1 PB | Large 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)
| Operation | Latency | Comparison |
|---|---|---|
| L1 cache reference | 0.5 ns | |
| L2 cache reference | 7 ns | 14x L1 cache |
| Main memory reference | 100 ns | 20x L2 cache |
| Send 1KB over 1 Gbps network | 10 μs (10,000 ns) | |
| Read 1 MB sequentially from memory | 250 μs | |
| Round trip within datacenter | 500 μs (0.5 ms) | |
| Read 1 MB sequentially from SSD | 1 ms | 4x memory |
| Disk seek | 10 ms | 20x SSD |
| Read 1 MB sequentially from disk | 30 ms | 30x SSD |
| Send packet CA→Netherlands→CA | 150 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
| Availability | Downtime/Year | Downtime/Month | Downtime/Week | Downtime/Day |
|---|---|---|---|---|
| 99% (two nines) | 3.65 days | 7.2 hours | 1.68 hours | 14.4 min |
| 99.9% (three nines) | 8.7 hours | 43.8 min | 10.1 min | 1.44 min |
| 99.99% (four nines) | 52.6 min | 4.38 min | 1.01 min | 8.64 sec |
| 99.999% (five nines) | 5.26 min | 26.3 sec | 6.05 sec | 864 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:
-
Time:
- 1 day = 100K seconds (close enough)
- 1 year = 30M seconds
-
Units:
- KB (thousand), MB (million), GB (billion), TB (trillion), PB (quadrillion)
-
Latency:
- Memory: 100 ns
- SSD: 1 ms
- Disk: 10 ms
- Network (datacenter): 0.5 ms
- Network (cross-region): 150 ms
-
Availability:
- 99.9% = 8.7 hours/year downtime
- 99.99% = 52 minutes/year downtime
-
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):
- AWS: https://aws.amazon.com/pricing/
- AWS Calculator: https://calculator.aws/
- GCP: https://cloud.google.com/pricing
- Azure: https://azure.microsoft.com/en-us/pricing/
1. Compute Costs (Servers)
AWS EC2 Pricing (US East region, on-demand):
| Instance Type | vCPU | RAM | Cost/Hour | Cost/Month | Use Case |
|---|---|---|---|---|---|
| t3.micro | 2 | 1 GB | $0.01 | $7.30 | Dev/test, very small apps |
| t3.small | 2 | 2 GB | $0.02 | $14.60 | Small web servers |
| t3.medium | 2 | 4 GB | $0.04 | $29.20 | Standard web servers |
| t3.large | 2 | 8 GB | $0.08 | $58.40 | Medium workloads |
| m5.large | 2 | 8 GB | $0.10 | $73.00 | General purpose |
| m5.xlarge | 4 | 16 GB | $0.19 | $138.70 | High traffic web servers |
| m5.2xlarge | 8 | 32 GB | $0.38 | $277.40 | Heavy workloads |
| c5.large | 2 | 4 GB | $0.09 | $65.70 | CPU intensive |
| r5.large | 2 | 16 GB | $0.13 | $94.90 | Memory 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):
| Instance | RAM | Cost/Hour | Cost/Month | Use Case |
|---|---|---|---|---|
| cache.t3.micro | 0.5 GB | $0.017 | $12.40 | Dev/test |
| cache.t3.small | 1.5 GB | $0.034 | $24.80 | Small cache |
| cache.m5.large | 6.4 GB | $0.147 | $107.00 | Standard |
| cache.m5.xlarge | 12.9 GB | $0.294 | $214.00 | Medium |
| cache.r5.large | 13.5 GB | $0.188 | $137.00 | Memory-optimized |
| cache.r5.xlarge | 27 GB | $0.376 | $274.00 | Large 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!)
- Use Reserved Instances: 40-60% discount for 1-3 year commitment
- Auto-scaling: Scale down during off-peak (save 30-50%)
- CDN for bandwidth: 3-5x cheaper than direct bandwidth
- S3 Lifecycle policies: Move old data to Glacier (5x cheaper)
- Spot Instances: 70-90% discount for non-critical workloads
- Right-size instances: Don’t over-provision (monitor and adjust)
- Multi-region carefully: Cross-region transfer is expensive
- Compress data: Reduce bandwidth and storage costs
- Cache aggressively: Reduce database load (fewer expensive servers)
- 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