# Mixed Self-Check — Cost & Capacity Estimation

Source: https://www.skillbyai.com/en/capacity-estimation/ce-self-check

> Test yourself across traffic, storage, queueing and cost estimation, and identify topics to revise.

## How to use this self-check

Work through each problem below on paper before reading the answer, carrying units on every line. **Problem 1**: an app has 30 million DAU, each making 20 API calls per day; what is the peak QPS with a peak factor of 3? (About 600,000,000 / 86,400, roughly 7,000 average, so about 21,000 peak.) **Problem 2**: 2 million images per day at 200 KB each, kept for 2 years with 3 replicas: what raw storage? (About 0.4 TB per day, roughly 290 TB logical, about 880 TB raw.) **Problem 3**: a worker pool sees 400 jobs per second, each taking 0.5 s; how many jobs run concurrently? (Little's Law: 200.) **Problem 4**: a cache at 95% hit ratio fronts 40,000 reads per second; what reaches the database? (2,000 per second.) If you missed one, revisit the matching section before the final quiz.

## Interview questions to practise aloud

Estimate the storage for a year of chat messages in a college messaging app. Estimate the servers needed for a ticket-booking sale opening at 10 a.m. Estimate monthly egress for a lecture-video platform. Explain why a database at 90% CPU is dangerous. Explain how you would verify your estimate after launch.

## Check your answers

Run the four self-check problems to confirm the arithmetic.

```python
p1_peak = 30e6 * 20 / 86_400 * 3
p2_raw_tb = 2e6 * 200e3 * 365 * 2 * 3 / 1e12
p3_inflight = 400 * 0.5
p4_db = 40_000 * (1 - 0.95)
print(f"1) peak QPS     ~ {p1_peak:,.0f}")
print(f"2) raw storage  ~ {p2_raw_tb:,.0f} TB")
print(f"3) concurrency  = {p3_inflight:.0f}")
print(f"4) DB reads     = {p4_db:,.0f}/s")
```

Output:

```
1) peak QPS     ~ 20,833
2) raw storage  ~ 876 TB
3) concurrency  = 200
4) DB reads     = 2,000/s
```

## Final traps to remember

Peak, not average. Bytes, not bits, for storage; bits for links. Multiply by replicas and variants. Keep utilisation below the knee. A queue buys time, not capacity. Give a range and name the bottleneck.

**Quiz:** A system has an average of 3,000 QPS, a peak factor of 4, servers that sustain 1,500 QPS each, a 50% utilisation target, and must survive losing one of two zones. How many servers in total?

- [ ] 16
- [ ] 8
- [ ] 24
- [x] 32

*Answer:* 32. Peak is 12,000 QPS. Each server is planned at 750 QPS, so 16 servers carry the peak. To survive losing one of two zones, each zone must hold all 16, so 32 in total.
