Walkthrough: Design a News Feed

Topics Covered

Step One: Requirements for the Feed

Opening the interview

Users, devices and networks

Functional scope

Non functional requirements

Estimating the shape of the data

Closing the requirements step

Where interviewers push in this step

This lesson works one complete design from the first minute to the last, using the six step framework from the first lesson of the course: requirements, architecture, data model and state, interface, deep dives and wrap up. The prompt is the most common one in frontend design interviews: design the news feed for a social product on the web. You have forty five minutes. The interviewer says the backend exists and you should focus on the client, but you may describe the API the client needs.

Read this lesson as a script you could speak. Each section shows what you would say, what you would draw and why, along with the places where interviewers usually push. The individual techniques, such as caching, performance metrics and real time transports, each have their own lesson earlier in the course. Here the goal is different: to show how those pieces combine into one coherent answer under time pressure, and how to choose which of them deserve depth.

Opening the interview

Start by restating the prompt and settling the boundary. A good opening sounds like this: so we are building the web client for a feed of posts from people the user follows. I will treat the feed service as given and focus on the browser side, and I will sketch the endpoints the client needs. Before I design anything, I want to spend about five minutes on scope. That takes twenty seconds, and it tells the interviewer three things at once: you know which side of the wire you own, you have a plan and you will not wander into fan out and sharding.

Then ask questions in a fixed order so you do not forget categories. Users and devices first, then features, then quality constraints. Write the answers down where the interviewer can see them, because you will point back at this list repeatedly.

Users, devices and networks

Who uses the feed and on what? For a large consumer product, assume a wide spread: desktop browsers on fast connections and a large share of mobile web users on mid range Android phones over unreliable 4G. That one answer shapes the whole design. A mid range phone has a CPU several times slower than a developer laptop, so main thread work matters. Unreliable networks mean requests fail and stall, so every fetch needs a loading state, a timeout and a retry path. Limited memory means you cannot keep thousands of rich post cards mounted.

Ask whether logged out users see the feed. For most social products the main feed sits behind a login, which means search engine visibility matters little for the feed itself, although individual post pages may need to be indexable. That distinction will matter when you choose a rendering strategy. Ask about locales too: if the product ships in right to left languages, the card layout must mirror, which is cheap to plan for now and expensive to retrofit.

Functional scope

List the features and then agree on the core subset. A full social feed has dozens: posts with text, images and video, likes, comments, shares, follow buttons, ads, stories, a composer, notifications and more. You cannot design all of them in forty minutes. Propose a core set and ask the interviewer to confirm it.

A good core set for this prompt is: an infinitely scrolling list of posts in ranked order; posts with text, author, timestamp and up to four images; a like button with a count; a notice when new posts are available; and a simple composer at the top that creates a text post. Comments, video playback, ads and stories are explicitly out of scope, though you will mention where they would plug in. Saying out loud what you are leaving out is part of the scoping signal, because it shows you saw it and chose.

Five minutes of scoping produce a short list that every later decision points back to.

Non functional requirements

Now turn quality into numbers. Interviewers reward candidates who state budgets rather than wishes. For this feed, reasonable targets are: the first screen of posts visible within about two and a half seconds on a mid range phone over 4G; interactions such as tapping like respond visually within a hundred milliseconds; scrolling stays smooth, meaning the main thread does not block for long stretches while new rows mount; layout shift close to zero, so posts do not jump as images load; and memory that stays roughly flat after the user has scrolled through several hundred posts. These map to the Core Web Vitals covered in the performance lesson: largest contentful paint, interaction to next paint and cumulative layout shift. You do not need to re-explain them here; naming the target for each is enough.

Add the constraints that are easy to forget. Accessibility: the feed must work with a keyboard and a screen reader, which matters for infinite lists because they are notoriously hard to navigate without a mouse. Resilience: if the network drops, the user can keep reading what has loaded, and the composer keeps their draft. Freshness: new posts should appear within roughly a minute, but the list must never move under the user without consent.

Estimating the shape of the data

Frontend designs benefit from small estimates too, because they size caches and payloads. Suppose each post is about one to two kilobytes of JSON without images, and a page holds twenty posts. A page is then around thirty kilobytes before compression and perhaps eight after, which is cheap. A heavy user may scroll two hundred to five hundred posts in a session. Keeping five hundred post objects in memory is a few megabytes of JavaScript data, which is fine. Keeping five hundred mounted post cards with images is not, because each mounted card holds DOM nodes, layout boxes and decoded image bitmaps. A decoded 1080 pixel wide image can take several megabytes of memory on its own. This simple arithmetic is the reason the design will separate the data, which you keep, from the rendered rows, which you recycle.

Closing the requirements step

End the step with a one breath summary: we are building a ranked, infinitely scrolling feed with text and image posts, likes, a new posts notice and a text composer, targeting mid range phones on 4G, with a first screen under about two and a half seconds, instant feeling likes, no layout shift, flat memory over long sessions, full keyboard and screen reader support, and graceful behaviour when offline. Comments, video and ads are out of scope. Then say: next I will draw the architecture. The summary takes fifteen seconds and gives the interviewer a clean place to correct you before you have invested time in the wrong direction.

Where interviewers push in this step

Two pushes are common. The first is about scope: an interviewer may ask you to add comments or video. Handle it by placing the feature in the plan, either as a deep dive candidate or as a component you will draw but not detail, rather than abandoning your schedule. The second is about devices: if you forgot to ask, the interviewer may say most of our users are on low end phones. Treat that as a gift, because it sharpens later decisions. Repeat it back and write it on the list. A candidate who silently absorbs a constraint loses the chance to show how it changes the design; a candidate who says that pushes me toward server rendering the first screen and keeping the JavaScript for the feed route small turns the hint into evidence.

A last point on pacing. Scoping a feed is easy to overdo, because every question seems relevant. Five or six questions and a written list are enough. If you find yourself past seven minutes, stop asking and propose defaults: I will assume a typical consumer mix of devices unless you tell me otherwise. Proposing defaults is faster than asking, and it still lets the interviewer correct you.

Turn every quality word into a number

Fast, smooth and stable earn nothing on their own. Say first screen under about 2.5 seconds on a mid range phone, tap feedback under 100 milliseconds and layout shift near zero, then point back at those numbers when you justify each mechanism.