Skip to the guide

Design a photo-sharing app (like Instagram)

IntermediateCase study12 pages

People post photos from their phones, follow each other and scroll a feed of photos that should appear at once, wherever they are. It's a photo lab that develops ten million films a day and keeps prints in a shop in every town.

It's also asked as "design Flickr". The closest case study is News feed, which designs the ranked feed; this page keeps its numbers and spends the deep dives on the photos. Interviewers like it because bytes dominate: 5 TB of photos a day, 25 GB a second of thumbnails at peak, and an upload path where the file and its database row must never disagree.

Below is a full mock interview following the seven steps of the framework. You're the candidate: at each Guess before you read on, stop and answer first.

Step 1 · Clarify the features and cut the scope

Minutes 0–5 · How this step works

Interviewer: Design Instagram.

You: A few questions first. Photos only, or video too? And how many photos in a post?

Interviewer: Photos, up to ten a post. Video may come later.

You: Who can see a post? Are there private accounts?

Interviewer: Accounts are public or private. A private account's posts are for approved followers only.

You: What do people do with posts: a home feed, a profile grid, likes? Can they edit?

Interviewer: All three. Captions can be edited, photos can't, and posts can be deleted. Treat the feed's ranking as solved.

You: Then I'll cover posting photos, the home feed, the profile grid, likes and private accounts. Out: video, stories, comments, messages, search and Explore. OK?

Interviewer: Go ahead.

Each answer shapes the design: photos that never change can be cached for a year under their own names, private accounts mean those names can't be public links, and the profile grid means posts are found by author.

Step 2 · Non-functional requirements

Minutes 5–8 · How this step works

You: Say 100 million daily users who open 20 feed pages a day, and 10 million photos posted a day. A feed page within 200 ms at p99 at our servers, with its thumbnails from an edge near the user. Viewing is 99.99% available and posting 99.9%. An uploaded photo is never lost, and a post reaches followers' feeds within about 10 seconds of Share, once its photo has arrived. A deleted post leaves feeds by the next page, and only approved followers get links to a private account's photos, links that die within the hour.