You're asked in an interview to estimate the average and peak queries-per-second (QPS) for a social app with 10 million daily active users (DAU), where each user makes about 20 read requests per day. Walk through how you'd compute average QPS and peak QPS, and why the two numbers differ.
answer
- DAU x actions/day / 86400s
- round 86400 to 100000
- peak = 2-3x average baseline
- provision for peak, not average
- diurnal traffic curve
basics
~10 sMultiply users by requests per user for total daily requests, divide by seconds in a day for average rate. Peak is higher because usage bunches at busy hours, so multiply average by 2-3x.
solid answer
~30 sTotal daily requests = DAU x requests/user/day = 10,000,000 x 20 = 200,000,000. Divide by seconds/day (~86,400, round to 100,000 for speed) to get average QPS of roughly 2,000-2,300. Traffic isn't uniform across 24 hours - it clusters around commute times, lunch, and evening - so apply a peak-to-average multiplier, commonly 2-3x for consumer apps, giving peak QPS in the 4,000-7,000 range. State rounding assumptions out loud, sanity-check the order of magnitude against known systems, and note the peak factor should ideally come from real traffic data rather than a guess.
go deeper
Should be able to compute average QPS from DAU and actions/user with guidance, and recognize (when prompted) that real traffic isn't flat across the day.
Should perform the calculation unprompted, round sensibly for speed, and apply a peak factor without being asked, stating it as an assumption.
Should proactively separate read/write QPS, justify the peak multiplier with reasoning about the specific product (global vs regional, viral potential), and connect the number directly to a provisioning decision.
Should treat the estimate as one input into a broader capacity strategy, discussing how the multiplier should be validated against real telemetry, how it interacts with autoscaling policy and cost, and how black-swan events (viral spikes) need protection beyond a fixed peak factor.
## Why this is the opening move Back-of-envelope QPS estimation is usually the opening move of a system design interview because it turns a vague business description - 'a social app with 10 million users' - into a concrete number that drives every downstream decision: - how many application servers to provision - whether a single database instance can survive the read load - how big a cache needs to be - how much headroom to build into autoscaling policies The mechanism itself is simple unit conversion, but doing it cleanly and defending the assumptions under interview pressure is a distinct skill from knowing the formula. ## The arithmetic, in two steps 1. **The first step** is defining the input clearly: daily active users (DAU) times actions per user per day gives total daily events. Here that's `10,000,000` users x `20` requests = `200,000,000` requests per day. 2. **The second step** converts that daily total into a rate by dividing by the number of seconds in a day. A day has `86,400` seconds, but experienced candidates round this to `100,000` in their head for faster arithmetic, since the resulting 15% error is irrelevant at the order-of-magnitude precision system design cares about. `200,000,000 / 100,000 = 2,000` QPS average (the precise figure is about 2,315, but 2,000 is close enough to reason with). This average is a useful baseline but it is not what you provision for, because it assumes requests are spread perfectly evenly across every second of the day, which no real traffic pattern does. ## Why peak runs ahead of average The reason average QPS understates what infrastructure must handle is that human activity follows a **diurnal curve**: usage is near zero at 3am local time and spikes during commute hours, lunch breaks, and evening leisure time. - If a service has users concentrated in a few time zones, the ratio between the busiest hour and the average hour can be large. - Globally distributed user bases smooth this out somewhat because peaks in one region overlap with troughs in another, but even global consumer apps commonly see peak hourly traffic at 2-3x the daily average. - Some verticals (news during breaking events, e-commerce during flash sales, ticketing at on-sale time) see peak-to-average ratios of 10x or more. The standard interview move is to apply a **peak factor** - 2x as a conservative floor, 3x as a common assumption absent better data - directly to the average QPS figure. Multiplying `2,000 x 2.5` gives roughly `5,000` peak QPS, which is the number that should actually inform capacity planning, since provisioning for the average would mean the system falls over precisely when it matters most: the busiest moments. ## The trade-off: rigor against the interview clock The trade-off inherent in this exercise is between analytical rigor and interview-clock speed. A perfectly rigorous answer would pull the real hourly distribution of traffic from historical monitoring data, fit it, and derive an exact peak-to-average ratio; interviews don't allow for that, so the accepted practice is to state an assumed multiplier explicitly, flag it as an assumption open to correction with real data, and move on. Failing to flag it - presenting the 2-3x figure as fact rather than a working assumption - is a common tell that a candidate is pattern-matching a memorized script rather than reasoning about the specific system in front of them. ## The failure mode in production The failure mode in production, correspondingly, is capacity planned entirely off an average QPS number: teams that provision for average load routinely discover their real ceiling only during an actual traffic spike, when requests start queueing, latency balloons, and the system degrades or falls over exactly during the highest-value traffic window (a product launch, a viral moment, Black Friday). A concrete real-world illustration: Twitter's engineering team has historically discussed handling roughly hundreds of thousands of tweets per minute in steady state, but has publicly described enormous multi-fold spikes during global events like World Cup matches or New Year's Eve, where their systems had to absorb traffic many times the baseline within seconds - exactly the peak-vs-average gap this exercise trains you to reason about before you ever touch a whiteboard architecture diagram. ## What is actually being tested The skill being tested is not the arithmetic itself but the instinct to ask 'peak or average?' before quoting a single QPS number, because every subsequent capacity decision in the interview - server count, database sharding, cache sizing - should be anchored to peak, with average kept around only as the number you'd use for cost estimation and steady-state resource utilization targets.
- Where would you actually get a realistic peak-to-average multiplier instead of guessing 2-3x?From historical monitoring/observability data - hourly or per-minute request-rate dashboards over several weeks, including at least one known high-traffic event, so you can read off the real ratio between peak and average. Absent that, product/marketing calendars (planned promotions, launches) and comparable-product benchmarks are the next best source.
- How would this estimate change for a globally distributed user base versus a single-region app?A single-region app sees a sharper diurnal curve because all users share roughly the same wake/sleep cycle, so the peak-to-average ratio tends to be higher. A globally distributed base smooths the curve because different regions peak at different UTC hours, lowering the peak-to-average ratio - though a single global event, like a live broadcast, can override that smoothing and cause a synchronized spike.
- Does write QPS need a separate estimate from read QPS, and why does it matter?Yes - reads and writes usually have very different ratios (many systems are read-heavy, e.g., 10:1 or 100:1 read:write) and are served by different infrastructure (read replicas and caches versus a primary database), so they need independent QPS figures to size each tier correctly rather than one blended number.
It's like sizing a highway: the average number of cars per hour over 24 hours looks manageable, but if you only build enough lanes for that average, the road gridlocks every single rush hour - you have to size for the worst hour, not the whole day's average.
saying these in an interview costs you the question
- Quotes only an average QPS and treats it as the number to provision for
- Can't explain why peak differs from average
- Picks a peak multiplier with no justification and states it as fact
- Gets lost in precise arithmetic (86,400 vs 100,000) instead of reasoning about the shape of the answer
- Never asks whether the estimate is for reads, writes, or both