Skip to content
We areTOP 1%

Design a photo-sharing service like Instagram

MediumConceptSocial Platforms
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews

Answer

Requirements: users upload photos with captions, follow other users, and view a feed of photos from people they follow. The system is heavily read-dominated, and uploaded photos must never be lost.

  • Upload: clients upload directly to object storage with a pre-signed URL; an upload event triggers workers that generate thumbnails and several resolutions.
  • Metadata: photo ID, owner, caption and storage keys live in a database sharded by user ID, using globally unique, time-sortable IDs such as Snowflake IDs.
  • Serving: images are delivered through a CDN; the feed is assembled from followed users' recent photo IDs, as in a news feed design.
  • Trade-off: pre-generating several image sizes costs storage and processing at upload time, but makes every later view faster and cheaper in bandwidth.

More in Social Platforms

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account