Home
← All questions

Design Instagram feed and Stories (frontend) | Frontend System Design

HardPremiumSystem Design

Asked at Meta · Google · Snap

Frontend System Design interview practice: Frontend system design for infinite feed, Stories ring, and media-heavy UX.

Problem

Design the frontend of Instagram's home screen on the web: a phone-first feed of photos, carousels and videos, plus the Stories tray and viewer, where people tap through full-screen photos and clips that auto-advance and disappear after 24 hours.

It's mostly media, so interviewers use it to test how you make images and video appear instantly without shifting the page or wasting data, how you build a gesture-driven, auto-advancing viewer, how you decide what to preload, and how you keep "seen" and expiry correct on devices with unreliable clocks and connections.

Functional requirements

  • Scroll the home feed of photos, carousels and videos, and like posts, including with a double tap.
  • Watch Stories: open a person from the tray, auto-advance through their photos and clips, tap to skip, hold to pause, swipe to the next person.
  • See new stories and posts without losing your place, and open the last feed offline.

Constraints

  • Mostly phones in the mobile browser, including low-end Android on slow networks.
  • The first photo shows within 2.5 seconds, a repeat open shows content in under 1 second, and a story opens in under 300 ms after the tap.
  • Scrolling and story transitions run at 60 frames per second, and nothing shifts as media loads.
  • A scroll of 20 posts costs a few megabytes, not tens, and data-saver users get less.
  • Expired stories never show, and the viewer is accessible to WCAG 2.2 AA: keyboard, screen reader, touch, and a way to pause.

Discussion areas

  • Core entities and key actions: what posts, media, the Stories tray, reels and segments are, and which user actions shape the design.
  • Architecture and rendering: how the app should render on a first visit and on the many repeat visits, the layers between UI components and the server, and the component tree.
  • Media: sizing, formats, placeholders and priorities for images and video in a feed.
  • Stories viewer: gestures, auto-advance timing for photos and clips, pausing, and moving between people.
  • Preloading: what to fetch ahead of time, how much, and how it changes on slow networks and low-end devices.
  • Seen state and expiry: recording what was watched, turning rings grey, and hiding stories after 24 hours.
  • API and freshness: endpoints for the feed, the tray and reels, and how new posts and stories reach an open app.
  • Likes and errors: instant likes, and what to do when a photo, a story segment or a request fails.
  • Offline and performance: opening from a cache without the screen jumping, and long scrolls on low-end phones.
  • Accessibility: using the feed and the Stories viewer with a keyboard, a screen reader and reduced motion.

Follow-up questions interviewers ask

  • Why cache first instead of waiting for fresh data?
  • Why store "seen up to" as a time instead of a list of seen ids?
  • How far ahead should stories preload?
  • Why does a video segment's progress bar follow the video's current time?
  • What happens when a story expires while someone is watching it?
  • Why correct the device clock?
  • Why no WebSocket or SSE for the feed?
  • How should several pause reasons combine?
Premium question

Unlock the full model solution for this question with Mentoxis Premium.

Unlock with Premium