Design a News Feed
Problem Statement
Design the client-facing architecture for a ranked news feed: an infinitely scrolling list of posts from accounts the user follows, mixed with recommended content, plus engagement actions like liking and reacting.
The interviewer usually sketches three surfaces:
- The feed screen itself, with infinite scroll and a "New Posts" pill at the top.
- A post detail screen reachable by tapping a feed item, with the comment thread.
- A composer that publishes a post and returns the user to the feed.
This walkthrough follows the Product Architecture framework: requirements, data model, API design, high-level client architecture, and product trade-offs.
This round lives above the API contract. You own three layers: the client UI, the client data layer, and the API and data model. The ranked ordering is produced by a ranking service behind the endpoint. Say that in one sentence, assume the endpoint returns a ranked page, and spend your time on how the client paginates it, caches it, updates it, and logs against it.
The System Design round asks for the same product from below the API line: fanout on write versus fanout on read, timeline storage, hot keys for high-follower accounts. See Design Twitter for that version. The difference is where the contract sits: this round starts at the response shape and works upward into the client, the System Design round starts at the same response shape and works downward into how it gets produced.
Common Aliases
- Design Facebook News Feed
- Design the home feed for a social app
- Design an infinite scroll social timeline
- Design Instagram home feed, client architecture
- Product architecture: news feed with ranking and real-time updates
Level Calibration
The same prompt is graded differently by level. The framework splits breadth and depth 80/20 at mid, 60/40 at senior, 40/60 at staff.
| Level | What a complete answer looks like |
|---|---|
| Mid-level | Typed feed items rather than a bare post array, a working cursor whose payload carries a position offset inside a pinned session, an optimistic like on an idempotent write, and one flow walked end to end from app open through swipe back. That is a complete pass. |
| Senior | All of that, plus session-expiry recovery that resumes in place instead of scrolling to the top, the argument for a pill over splicing into the live list, and the count reconciliation rule when a second tap lands while the first request is still open. |
| Staff+ | All of that, plus impressions treated as the ranking signal rather than as plumbing, cache lifetime and account isolation as a privacy boundary, and an honest sizing of what the pinned snapshot costs against the stateless alternative. |
The depth below is written at senior-to-staff. A mid-level reader should treat the deep dives as reference, not as a script to deliver.