Skip to content
SD-4 · System design

Design a Photo Social Network

Asked at Mid level45 minutes
Our answers stay hidden until you reveal them.

Design a photo sharing app. People post a photo with a caption, follow other accounts, and scroll a home feed of recent posts from the accounts they follow. They can like and comment, and open any profile to page through a grid of its posts.

The app has 500 million daily users who open the feed about 12 times a day, and 100 million new photos are posted a day. Two things make it hard. The bytes: a photo arrives from the phone at about 2 MB and is then shown billions of times a day, so it must be resized and served from the edge. And the fan-out: every post must reach the feeds of all its author’s followers, about 300 on average but over 100 million for the biggest accounts.

Good questions to ask first

Decide what you would assume for each before you look at ours.

  1. 1Photos only, or video too?
  2. 2How is the feed ordered?
  3. 3How fresh must the feed be?
  4. 4How many photos per post, and how big?
  5. 5Can posts be edited or deleted?
  6. 6Public or private accounts?
  7. 7How big can an account get?
  8. 8Do we need likes and comments?

How to spend the 45 minutes

  1. 5minPart 1: Requirements and scope
  2. 5minPart 2: Estimates
  3. 5minPart 3: API
  4. 15minPart 4: Architecture, stage by stage
  5. 15minPart 5: Deep dives and trade-offs
Sketch your own design: boxes, arrows and the numbers that matter. Then compare it with ours.Break it in the labVisual walkthrough