Learn to Code
All tracks
Learn to Code

Free lessons from scratch to pro — every language, databases and DevOps.

AboutContactPrivacy PolicyTerms of Use

Your progress is saved in this browser. © 2026 Learn to Code

SD
System Design
0/13 completed
Beginner
What is system design?How the internet worksBack-of-the-envelope estimation
Intermediate
Scaling basicsLoad balancersCachingDatabases at scale
Advanced
Sharding and consistent hashingMessage queues and event streamingConsistency, CAP and distributed transactionsReliability and observability
Pro
Designing a URL shortenerDesigning a chat app
Tracks / System Design / Beginner

Back-of-the-envelope estimation

Before choosing components, estimate the scale: how many requests per second, how much storage, how much bandwidth? Numbers decide whether one database is enough or you need fifty, whether data fits in memory, and what it will cost. The goal isn't precision, it's the right order of magnitude, reached quickly with round numbers.

Handy numbers

Fact Approximation
Seconds in a day 86,400 ≈ 100,000 (10⁵)
Seconds in a month ≈ 2.5 million
Seconds in a year ≈ 30 million
1 KB / 1 MB / 1 GB / 1 TB / 1 PB 10³ / 10⁶ / 10⁹ / 10¹² / 10¹⁵ bytes
A character (ASCII) / an integer / a UUID 1 byte / 4–8 bytes / 16 bytes
One modern server, simple API ~1,000–10,000 requests/second
One relational database (well indexed) ~1,000–10,000 writes/s, more reads
Redis ~100,000+ operations/second per node

Peak traffic is often 2–10× the average (evenings, sales, news events). Design for the peak.

Requests per second

A social app has 50 million daily active users. Each opens the feed 10 times a day and posts once every 5 days.

Python · editable

A 50:1 read-heavy workload suggests caching and read replicas will matter more than write throughput.

Storage

Python · editable

About 9 TB of rows (27 TB with replicas) is manageable for a relational database split across a few shards; nearly 2 PB of images belongs in object storage (S3, GCS) behind a CDN, never in the database.

Bandwidth

Python · editable

Servers and memory

How many app servers? And can the "hot" data be cached in memory?

Python · editable

Doing it in an interview

  • State assumptions out loud and round aggressively (86,400 → 100,000).
  • Write the formula before the numbers: QPS = DAU × actions per user ÷ seconds per day.
  • Look for the conclusion: "read-heavy, so cache", "petabytes, so object storage", "this fits in one machine's memory".
  • Keep it quick: estimation is a tool to make decisions, not the decision itself.

Practice

  1. A video platform has 10 million daily viewers who watch 30 minutes each at 3 Mbit/s. What's the average outgoing bandwidth?
  2. A URL shortener creates 100 million links per month; each record is 500 bytes. How much storage after 10 years?
  3. A chat app has 20 million users sending 40 messages a day. How many messages per second at a 5× peak?
✎ Check your understanding

1.Roughly how many seconds are in a day, for quick estimates?

2.Why design for peak traffic rather than the average?

3.An estimate shows 2 PB of user photos after five years. Where should they live?

← How the internet works