<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: designbench.dev</title>
    <description>The latest articles on DEV Community by designbench.dev (@designbench).</description>
    <link>https://dev.to/designbench</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4250836%2F021af548-d586-41a7-bcd7-d682e47f0bc9.png</url>
      <title>DEV Community: designbench.dev</title>
      <link>https://dev.to/designbench</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/designbench"/>
    <language>en</language>
    <item>
      <title>Back-of-the-envelope estimation for system design interviews: size a 200M-user photo app in five minutes</title>
      <dc:creator>designbench.dev</dc:creator>
      <pubDate>Thu, 19 Nov 2026 02:57:35 +0000</pubDate>
      <link>https://dev.to/designbench/back-of-the-envelope-estimation-for-system-design-interviews-size-a-200m-user-photo-app-in-five-3975</link>
      <guid>https://dev.to/designbench/back-of-the-envelope-estimation-for-system-design-interviews-size-a-200m-user-photo-app-in-five-3975</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The interview question:&lt;/strong&gt; "Design a photo-sharing app for 200 million daily users." Before you draw a single box, the interviewer expects you to put numbers on it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Back-of-the-envelope estimation is not about being right to three decimal places. It is about getting the &lt;strong&gt;order of magnitude&lt;/strong&gt; right, fast and out loud, so you know which problems are real: one database or a hundred, one network link or a CDN. Here is how to do it, round by round, using the same numbers as the &lt;a href="https://designbench.dev/learn/estimation" rel="noopener noreferrer"&gt;Designbench estimation lesson&lt;/a&gt;, where every step is interactive.&lt;/p&gt;

&lt;h2&gt;
  
  
  Round 1: Why bother with rough numbers?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Interviewer:&lt;/strong&gt; Why not just start designing?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You:&lt;/strong&gt; Because the numbers decide the design. 200 requests per second fits on one database; 200,000 does not. 7 TB fits on a few machines; 500 PB needs an object store. Two minutes of arithmetic tells me which problems deserve the next 40 minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Round 2: Know what is fast and what is slow
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Interviewer:&lt;/strong&gt; Before the math, how long do things actually take?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You:&lt;/strong&gt; I keep a short ladder in my head. Each rung is roughly 100 to 1,000 times slower than the one before:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Operation&lt;/th&gt;
&lt;th&gt;Real time&lt;/th&gt;
&lt;th&gt;If 1 ns were 1 second&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;L1 cache reference&lt;/td&gt;
&lt;td&gt;1 ns&lt;/td&gt;
&lt;td&gt;1 second&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Read from main memory (RAM)&lt;/td&gt;
&lt;td&gt;100 ns&lt;/td&gt;
&lt;td&gt;under 2 minutes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SSD random read&lt;/td&gt;
&lt;td&gt;100 µs&lt;/td&gt;
&lt;td&gt;about a day&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Round trip inside a datacenter&lt;/td&gt;
&lt;td&gt;500 µs&lt;/td&gt;
&lt;td&gt;almost 6 days&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hard disk seek&lt;/td&gt;
&lt;td&gt;10 ms&lt;/td&gt;
&lt;td&gt;nearly 4 months&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Round trip California ↔ Netherlands&lt;/td&gt;
&lt;td&gt;150 ms&lt;/td&gt;
&lt;td&gt;almost 5 years&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkwwmn0547byi1x8ksde9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkwwmn0547byi1x8ksde9.jpg" alt="The latency ladder on Designbench" width="800" height="416"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The latency ladder on Designbench, scaled so 1 ns is 1 second.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;What that means for design:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Memory beats disk&lt;/strong&gt;, which is why caches exist. See &lt;a href="https://designbench.dev/learn/caching" rel="noopener noreferrer"&gt;Caching and CDNs&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network hops add up.&lt;/strong&gt; Ten sequential service calls inside one datacenter cost about 5 ms before any real work happens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Distance is physics.&lt;/strong&gt; You cannot optimise away 150 ms across an ocean; you move the data closer with a CDN or another region. See &lt;a href="https://designbench.dev/learn/replication" rel="noopener noreferrer"&gt;Replication&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The figures are approximate, from the classic "latency numbers every programmer should know" list. Hardware has moved some of them, but the ratios are what matter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Round 3: The shortcuts that do most of the work
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;You:&lt;/strong&gt; Five facts cover almost every interview:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A day is about 10⁵ seconds&lt;/strong&gt; (86,400). So 1 million requests a day is about 12 per second, and 1 billion a day is about 12,000 per second.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A year is about 3 × 10⁷ seconds&lt;/strong&gt; (31.5 million).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Peak is 2–3× the average&lt;/strong&gt; for a normal daily cycle. Launches, sales and live events can be 10–100×.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Size units step by 1,000:&lt;/strong&gt; KB, MB, GB, TB, PB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Little's law:&lt;/strong&gt; requests in flight = arrival rate × time each request takes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Round 4: Size the photo app, one number at a time
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Interviewer:&lt;/strong&gt; Go ahead. 200 million daily users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You:&lt;/strong&gt; I'll state my assumptions first; stop me if one is off. Each user makes 20 requests a day, 5% of requests are uploads of about 500 KB, and we keep photos for 5 years.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;Math&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Requests per day&lt;/td&gt;
&lt;td&gt;200M × 20&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;4 billion&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Average per second&lt;/td&gt;
&lt;td&gt;4B ÷ 86,400&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;≈ 46,000&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Peak per second&lt;/td&gt;
&lt;td&gt;× 3&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;≈ 139,000&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;App servers&lt;/td&gt;
&lt;td&gt;139K ÷ 5K per server&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;≈ 28&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;New data per day&lt;/td&gt;
&lt;td&gt;200M uploads × 500 KB&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;100 TB&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Storage, 5 years, 3 replicas&lt;/td&gt;
&lt;td&gt;100 TB × 365 × 5 × 3&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;≈ 548 PB&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmfam9b5qkho87zypnrtg.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmfam9b5qkho87zypnrtg.jpg" alt="The photo-app sizing story on Designbench" width="800" height="416"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The photo-app story on Designbench, step 8 of 8.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That last number changes the design. Photos go to an object store such as S3, not a database. Metadata (who uploaded what, and when) lives in a database that stays small by comparison.&lt;/p&gt;

&lt;h2&gt;
  
  
  Round 5: Go one step further than most candidates
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Interviewer:&lt;/strong&gt; Anything you'd add?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You:&lt;/strong&gt; Three numbers most candidates skip:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Headroom.&lt;/strong&gt; Servers at 100% fall over. At a 70% utilisation target, 139K ÷ (5K × 0.7) ≈ &lt;strong&gt;40 servers&lt;/strong&gt;, plus a spare in each zone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bandwidth.&lt;/strong&gt; About 95% of requests are reads. If an average read serves 200 KB (mostly thumbnails), peak egress is 132K × 200 KB ≈ &lt;strong&gt;26 GB/s, about 210 Gbps&lt;/strong&gt;. That is a CDN problem, not an app-server problem. Uploads add about 7,000 per second × 500 KB ≈ 3.5 GB/s of ingress.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Concurrency.&lt;/strong&gt; QPS is not the number of connections. By Little's law, 139K requests per second that each take 100 ms means only about &lt;strong&gt;14,000 in flight&lt;/strong&gt; at once. Long-lived WebSocket connections are a separate number again.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Round 6: Practise on any system
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://designbench.dev/learn/estimation" rel="noopener noreferrer"&gt;estimator on Designbench&lt;/a&gt; runs the same chain for any inputs. With its defaults (100M daily users, 10 requests each, 1% writes of 0.5 KB, kept 5 years) you get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Average about 11.6K per second, peak about 34.7K&lt;/li&gt;
&lt;li&gt;At peak, about 34.4K reads and 350 writes per second&lt;/li&gt;
&lt;li&gt;5 GB of new data a day, about 9 TB over 5 years, about 27 TB with 3 replicas&lt;/li&gt;
&lt;li&gt;About 7 app servers at 5K QPS each, and about 3,500 requests in flight&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fihrprdqngypw4cequj70.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fihrprdqngypw4cequj70.jpg" alt="The estimator on Designbench" width="800" height="416"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The estimator on Designbench with its URL shortener preset. Move any slider and every number updates.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Notice the shape: a read-heavy system where writes are tiny. That points to caches and read replicas, not sharding. Reads scale with caches and replicas; writes scale only with sharding, batching or doing less work. See &lt;a href="https://designbench.dev/learn/sharding" rel="noopener noreferrer"&gt;Sharding&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Round 7: Say it in 60 seconds
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;"Assume 200M daily users making 20 requests each: 4 billion a day, about 46K per second on average and about 140K at peak, so 30 to 40 app servers with headroom. 5% are 500 KB uploads, so 100 TB of new photos a day, about half an exabyte over 5 years with 3 copies. That means an object store and a CDN for reads, with a metadata database that stays small. The first thing to break is read bandwidth, so the CDN comes first."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Common mistakes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sizing for the average.&lt;/strong&gt; Say which peak you are designing for.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Confusing QPS with concurrency.&lt;/strong&gt; Use Little's law.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Forgetting replicas and overhead.&lt;/strong&gt; Three replicas triple storage; indexes, metadata and free space add another 30–100%.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ignoring bandwidth.&lt;/strong&gt; For media, bytes per second run out long before CPU does.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treating reads and writes the same.&lt;/strong&gt; They scale in different ways.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;False precision.&lt;/strong&gt; "11,574 QPS" invites "why?". Say "about 12K" and name the assumptions behind it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Practise it
&lt;/h2&gt;

&lt;p&gt;Step through the photo-app story, race the latency ladder and play with the estimator in &lt;a href="https://designbench.dev/learn/estimation" rel="noopener noreferrer"&gt;Back-of-the-envelope math on Designbench&lt;/a&gt;, part of the free first chapter. Then size real systems: a &lt;a href="https://designbench.dev/learn/url-shortener" rel="noopener noreferrer"&gt;URL shortener&lt;/a&gt; and a &lt;a href="https://designbench.dev/learn/news-feed" rel="noopener noreferrer"&gt;news feed&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>systemdesign</category>
      <category>interview</category>
      <category>programming</category>
      <category>career</category>
    </item>
  </channel>
</rss>
