Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Resilient Infinite-Scroll Social Feed

Design the client and API contract for a long, media-rich social feed that paginates stably, renders smoothly, and recovers from retries, refreshes, and navigation.

Problem statement

For this exercise, assume an authenticated web or mobile client displays a reverse-chronological social feed using infinite scrolling. The backend already decides which feed items the user may see; your design owns the page API contract and the client data, rendering, prefetch, cache, refresh, and recovery behavior.

New items can arrive while the user is scrolling, items may be deleted, media is loaded separately, and page requests may be retried or return overlapping results.

The client must not visibly duplicate cards, skip known items because of unstable pagination, jump the viewport during background refresh, or grow memory without bound during a long session.

Design stable pagination semantics, client state and merging, list virtualization, scroll-position restoration, media loading, offline and reconnect behavior, observability, accessibility, and safe evolution across client versions.

Ranking, post creation, comments, likes, notification delivery, and the backend fanout algorithm are outside scope.

What to build

  1. A client can load an initial feed and append older pages through a stable bounded cursor contract.
  2. A client can discover newer items and merge overlapping or deleted results without duplicate cards or disruptive viewport jumps.
  3. A client can smoothly render, prefetch, and evict content during a long media-rich session while preserving logical position.
  4. A client can survive retries, temporary disconnection, navigation away and back, and compatible application upgrades with an understandable cached result.

At scale

  • For this exercise, a feed page contains at most 30 items, one session may traverse 10,000 items, and cards may reference images or video whose bytes are served from a CDN.
  • For this exercise, target initial usable content within 1 second at p75 on a warm cache and 2.5 seconds on a normal mobile network, with scrolling that does not perform unbounded DOM or view work.
  • For this exercise, prefetch at most two pages ahead, keep at most 300 fully materialized cards in memory, and restore the user's logical anchor within one card after navigation.
  • For this exercise, page results may overlap and new or deleted items may appear during a session; cursor tokens expire after 24 hours and the client must recover through a fresh snapshot rather than silently inventing continuity.