Estimate the Cost of Storing Photos
Problem
A photo-sharing app has 100 million daily active users who upload photos from their phones. Estimate what it costs to store those photos: the new storage per day and per year, the cost per month at the end of the first year, and the cumulative bill over the first year. Then say what you would do to cut it.
- Include the derived copies the app must keep (thumbnails and a display-size rendition), not just originals.
- Use published cloud object-storage prices as the reference, and compare against owning the hardware.
- Storage cost only; ignore bandwidth, transcoding CPU, and database costs unless you think one of them changes the conclusion.
Examples
Inputs the estimate rests on (each is easy to defend or to swap out):
- Uploads: 2 photos per DAU per day on average (most users upload nothing on a given day; some upload dozens).
- Original size: ~3 MB for a modern phone photo (12-megapixel JPEG or HEIC).
- Derived copies: a 200 KB display rendition and a couple of thumbnails totaling ~50 KB, so ~0.25 MB per photo, under 10% of the original.
- Cloud object storage prices: roughly $0.02 per GB-month for the standard hot tier, ~$0.01 for infrequent access, ~$0.004 for archive/cold, and around $0.001 for deep archive. These are approximate public list prices; the interviewer will accept "two cents a gigabyte-month" as the hot-tier reference.
- Owned hardware: a 20 TB hard drive costs ~$300, so ~$15 per TB of raw capacity, before servers, power, network, replication, and people.
- Deletion: users rarely delete. Assume photos are kept indefinitely.
- Durability: managed object storage already includes replication in its price; if you own the hardware, you must add ~1.5× for erasure coding or 3× for replication.
Hints
- Bytes first, dollars second. Get the daily ingest, then multiply by a per-GB-month price.
- Storage cost is cumulative: each month you pay for everything uploaded so far, not just this month's uploads. The monthly bill grows linearly and the cumulative bill grows quadratically.
- Most photos are viewed within a week of upload and almost never after a year. That access pattern is the entire argument for tiering.
Last reviewed 8 September 2026
Approach · Answer · Complexity · Follow-ups · Company variations
The rest of this question — the worked approach, the Python solution with passing tests, complexity, follow-ups and how each company frames it — is part of the guides.
Get the full guide
Pick the company you're interviewing with. Each guide has every question tiered for that loop — one-time purchase, lifetime access.
Also in: Apple, Google, Meta, Microsoft, Netflix
Interviewing at more than one? All 6 guides for $499 · save $395
Not ready to buy? Get the free starter pack — 13 questions with full solutions.