← Questions

Design Instagram Stories that expire after 24 hours

0
MetaSystem designLast asked Sep 2026

Design the stories feature of a photo and video app. Users post photos or short videos as stories that their followers can view for 24 hours, after which they disappear. At the top of the app each user sees a tray of followed accounts that have stories they haven't watched yet; tapping an account plays its active stories in order. The app has hundreds of millions of daily users.

Requirements

  • Functional: post a photo or short video as a story; show the tray of followed accounts with unwatched stories; play an account's stories in order; mark stories watched per viewer; let authors see who viewed each story; hide stories after 24 hours.
  • Non-functional: the tray loads on every app open, so it must be fast (tens of milliseconds); smooth playback; an expired story is never shown; high availability; very large followings handled.

Clarifying questions

  • How many daily users and stories per day, and what are typical and largest follower counts?
  • Can authors see who viewed, and must view counts be exact?
  • Are restricted audiences, such as a close-friends list, in scope?
  • What are the maximum video length and supported formats?
  • Must "watched" state sync across a viewer's devices?

What a strong answer covers

  • Upload: direct-to-object-storage upload with a signed URL, media processing (transcoding, thumbnails), CDN delivery, and the story record written only once media is ready.
  • The tray: what it needs per followed account (latest story time, whether anything is unwatched) and how small that can be; fan-out on write for most authors, fan-out on read for accounts with huge followings, and the hybrid.
  • Expiry: an expires_at checked at read time so an expired story is never served, with background cleanup and cache TTLs aligned to it.
  • Watched state and viewer lists: per-viewer watched sets (compact, with TTL) and per-story viewer lists, and the write load a huge account creates.
  • Audience restrictions and blocks enforced on the read path; prefetching the next stories for smooth playback.

Follow-ups

  • How would you rank the accounts in the tray?
  • An account with 100 million followers posts. What load does that create on the tray and on viewer-list writes?
  • How would you let authors keep chosen stories on their profile past 24 hours?
  • How do you guarantee an expired story is never shown even when some caches are stale?
Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing