Skip to the page

Reliability and scale · Design

Back-of-the-envelope estimation for a photo app

The interviewer asks

Before we design anything, estimate the scale for a photo-sharing app with 10 crore daily active users. How many uploads and feed reads a second, how much storage a year, and how much bandwidth?

Then

Follow-ups the interviewer asks next

  1. What assumptions do you make, and which would you check with me?
  2. Uploads a second, on average and at peak?
  3. Storage a year, with smaller versions and copies?
  4. Feed reads a second, and the bandwidth for images?
  5. Roughly how many servers for the feed API?
  6. Which of these numbers changes the design, and how?
  7. Which numbers do you keep in your head for this?

The answer

What a strong answer covers

  • Says assumptions out loud: 10 crore daily users; 10% upload one photo a day (1 crore uploads); each user opens the feed 10 times and sees 20 photos each time (2,000 crore image views a day).
  • Rates: 1 crore over 86,400 seconds is about 115 uploads a second, maybe 500 at peak. Feed: 100 crore requests a day is about 11,600 a second, maybe 50,000 at peak.
  • Storage: about 2 MB per original plus 300 KB of resized versions, so about 23 TB a day and 8.4 PB a year before copies. With 3 replicas, or erasure coding at about 1.5x, plan for 13 to 25 PB.
  • Bandwidth: 2,000 crore views × 100 KB is about 2 PB a day, about 185 Gbps on average, so nearly all of it must come from a CDN.
  • Servers: at 2,000 to 5,000 feed requests a second per node, 50,000 at peak needs 10 to 25 nodes plus headroom across zones. The numbers to watch are cache memory and database queries, not app servers.
  • Handy numbers: a day is about 10^5 seconds; 1 crore is 10^7; a memory read is about 100 ns, an SSD read about 100 µs, a round trip inside a region under 1 ms, India to the US East coast about 200 ms.
  • Ends with what the numbers mean: read-heavy, so caching and a CDN; huge storage, so object storage with cheaper tiers.

The red pen

Common traps

Avoid:ten minutes of exact arithmetic; no peak factor; forgetting copies and resized versions; numbers that never change the design.

Practise this out loud

Say your answer out loud to an AI interviewer that follows up, and get a score for it.

Practise by voice

Practise questions like this out loud

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview