Estimate
๐๏ธ How to estimate scale in a High-Level Design (HLD) Interview?
Estimating scale helps you choose the right technologies, plan for growth, and communicate your understanding of real-world systems.
โ What to Estimate?
- ๐ฅ Users (DAU / MAU)
- ๐ Requests / Query per second (RPS / QPS)
- ๐ฆ Storage
- ๐งฎ Bandwidth
๐ฅ 1. Estimate Users
Estimate Daily Active Users (DAU) and Monthly Active Users (MAU) based on the app type.
Heuristics:
- Social media: DAU โ 10โ30% of MAU
- Admin/dashboard apps: DAU โ MAU
- Ticketing/event apps: Spiky traffic
Example:
If MAU is 10M, assume 1โ3M DAU.
Say in interview:
โLetโs assume 5M monthly active users, and around 1M daily active users.โ
๐ 2. Requests Per Second (RPS)
๐ฏ Formula
RPS โ (DAU ร Requests per User per Day) รท 10^6
Use 10^6
(instead of 86400 seconds in a day) for simplicity in interviews.
๐ง Example
- DAU = 1,000,000
- Avg 5 requests/day/user
RPS = (1M ร 5) รท 1M โ 5 RPS
Advanced: Split by Type
- 70% reads โ 3.5 RPS
- 30% writes โ 1.5 RPS
โWeโll need to optimize for reads and cache aggressively.โ
๐ฆ 3. Estimate Storage
๐ฏ Formula
Storage = Avg object size ร Number of objects
Example
- 1 post = 500 bytes
- 10M posts/month = 10^6 posts/month
Storage = 500 bytes ร 10^6 = ~5 GB/month
Use 10^6
(instead of 1024 take 10^3
in unit calculation) for simplicity in interviews.
- 1-year retention = 60 GB
โWeโll need ~5 GB/month, or ~60 GB/year for post storage.โ
๐งฎ 4. Estimate Bandwidth
๐ฏ Formula
Bandwidth = RPS ร Avg response size
Example
- 60 RPS
- Avg response = 50 KB
Bandwidth = 60 ร 50 KB = 3 MB/s
- Daily: 3 MB/s ร 86400 = ~250 GB/day
โOur outgoing traffic will be ~250 GB/day, mainly due to read-heavy load.โ
๐ Summary Table
Metric | Formula | Example |
---|---|---|
Users | Estimate DAU from MAU | MAU = 10M โ DAU โ 1โ3M |
RPS | (DAU ร reqs/day) รท 10^6 | (1M ร 5) รท 10^6 = ~5 RPS |
Storage | Size/item ร # of items | 500 B ร 10M = ~5 GB/month |
Bandwidth | RPS ร response size | 60 RPS ร 50 KB = ~3 MB/s |
๐ก Interview Power Move
Say something like:
โGiven 1M DAU and ~5 RPS, we expect read-heavy traffic, so weโll cache results using Redis/CDN. Storage needs are modest (~5 GB/month), and bandwidth can be optimized via compression.โ
Tip: Clear, quantitative estimates show you understand real-world system constraints and can communicate trade-offs effectively.