Lesson 16 of 30
A news feed prompt tests whether you can assemble already-known building blocks — pagination, caching, rendering performance — into one coherent answer, plus handle the one genuinely new wrinkle: new content arriving while someone is mid-scroll.
14 min read
Every option explains itself — why the right one is right, and why each wrong one is wrong. Miss one and it comes back later on a spaced-repetition schedule.
Question 1 of 3
A social feed's underlying dataset has new posts inserted at the front constantly. Why does offset-based pagination ("give me items 20-40") break down here specifically?
Hints without spoilers, and a plain explanation of why a wrong answer was wrong — answered only from this lesson. Free account, no card.
Sign up freeWhat interviewers actually ask about this, and what a strong answer has to cover.
A strong answer covers
Likely follow-ups
"Design the frontend architecture for a social media news feed" (Twitter/Instagram-style, continuously scrolling) is one of the most common frontend system design prompts, and its strength as a question is that it's really three already-solved problems stacked together, plus one genuinely new one:
A strong answer names each of these explicitly and reaches for the right existing tool for the first three, spending its real thinking time on the fourth.
Walking this prompt as an interview answer: the pagination shape is the classic argument for cursor-based pagination over offset-based — this track's pagination-strategy reasoning applies directly here, since a feed is exactly the case where offset breaks down. New posts are constantly inserted at the front of the underlying data, so an offset like "give me items 20–40" silently shifts under you between requests, duplicating or skipping posts. A cursor ("give me everything after post abc123") stays stable regardless of what's been added ahead of it.
Caching needs the normalized client-state shape this track's client-side state architecture lesson covers: a post that shows up in both the main feed and a user's profile is the same entity, not two independent copies. Store each post once, keyed by id, and have both views reference it — a like or edit updates one record and both views reflect it instantly, instead of drifting out of sync because only one copy got touched.
Rendering hundreds of scrolled-past posts is a natural fit for list virtualization, covered in the Web Performance track — worth naming as an ingredient here, not re-explaining; this lesson's job is recognizing where it fits, not implementing it.
"Design a news feed" is a canonical frontend system design prompt precisely because a strong answer has to correctly assemble pagination, caching consistency, and rendering performance while also handling the live-update UX question — breadth and judgment both get tested at once.