- 20 of 909 candidate reports mention it; 15 are Meta. 3 are from the last 90 days: Meta E6, xAI and LinkedIn.
- The central trade-off is fan-out on write (push) vs fan-out on read (pull). Most good answers use a hybrid: push for normal users, pull for accounts with huge follower counts.
- Store only post IDs in each user's feed cache and fetch post content separately. Edits, deletes and like counts then stay current.
- Use cursor-based pagination, not page numbers, or new posts will cause duplicates as the user scrolls.
- Senior answers bring numbers that justify the hybrid and cover the celebrity hot key, fan-out lag, and how deletes and unfollows are handled.
Who asks it and how often
We coded 909 first-hand candidate reports that list questions, dated January 2025 to November 2026. 20 mention a news feed, Twitter, Instagram or Facebook feed design. Counting only reports that name a single company: Meta 15, and one each from Pinterest, OpenAI, xAI and LinkedIn. 3 of the 20 are from the last 90 days.
A related question, ML design of feed ranking or recommendations, appears in 18 reports (4 in the last 90 days), mostly Meta (11) and LinkedIn (2). That one is asked in ML engineer loops and focuses on the model rather than on storage and fan-out.
| Company | What candidates describe |
|---|---|
| Meta | E6, Nov 2026: news feed design plus an ad click aggregator design, in a loop with an AI-assisted coding round [1]. Mar 2026: design Twitter with post, retrieve and search [6]. E5 infra, Dec 2025: Instagram feed with fan-out and consistent hashing [7]. E4, Jun 2025: Facebook feed post design focused on the API; that candidate's design round was rated No Hire [8]. |
| xAI | Sep 2026: design delayed or scheduled tweets. The candidate was rejected and suspected the design answer [2]. |
| Sep 2026: design post search with keyword include and exclude filters plus ranking. The candidate failed the design round [3]. | |
| OpenAI | Jul 2026: a social media feed as a coding problem, not a design round [4]. |
| No company named | Jul 2026, Reddit: design Twitter in a combined high-level and low-level design round [5]. |
Most of the Meta reports come from LeetCode Discuss posts in early 2025, so the overall count leans on older data. Two variants recur: plain feed (Instagram, Twitter, Facebook) and feed plus search over posts. Prepare both.
Meta's careers FAQ says its design interviews run in CoderPad with Mermaid Markdown and a built-in AI assistant [9]. Practise sketching this design as text.
Clarifying questions to ask
- Which product? Twitter-style one-way follows, Facebook-style two-way friends, or Instagram with heavy media. This sets the follower distribution and storage.
- Chronological or ranked? Ranked feeds add candidate generation and a scoring step.
- What scale? Ask for daily active users, posts per day, average follows, and the largest follower count (the celebrity case).
- How quickly must a new post appear in followers' feeds? Seconds is usual.
- Text only, or images and video too?
- What is in scope? Likes and comments counts, search, notifications, ads. Usually you keep the core feed and park the rest.
- Is it infinite scroll, and how far back can a user go?
Requirements
- Functional: create a post (text, optional media); follow and unfollow; load the home feed newest-first or ranked, with infinite scroll; see your own new post right away.
- Non-functional: feed loads in a few hundred milliseconds at the 99th percentile; posts reach followers within seconds (eventual consistency is fine); very high availability for reads; reads far outnumber writes.
A back-of-envelope estimate, with assumed numbers: 200 million daily users who open the feed 10 times a day make 2 billion feed reads per day, about 23,000 per second on average and perhaps 50,000 at peak. 20 million posts per day is about 230 per second. With 200 followers on average, pushing every post into every follower's feed means 4 billion feed inserts per day, roughly 46,000 per second. A feed cache of 500 post IDs per user at 8 bytes each is 200M x 500 x 8 bytes = about 800 GB, which needs a Redis cluster.
Reads dominate, so precomputing feeds pays off. But one account with 100 million followers would turn a single post into 100 million writes, which is why pure push fails.
API
POST /v1/media/uploads -> { uploadUrl, mediaId } # client uploads directly to object storage
POST /v1/posts { "text": "...", "mediaIds": ["m_1"] } -> { postId, createdAt }
DELETE /v1/posts/{postId}
PUT /v1/users/{userId}/following/{targetId} # follow
DELETE /v1/users/{userId}/following/{targetId} # unfollow
GET /v1/feed?cursor=<opaque>&limit=20
-> { "items": [ { postId, author: {id, name, avatarUrl}, text, media, createdAt, likeCount } ],
"nextCursor": "<opaque>" } The user ID comes from the auth token, not the URL, for the feed call. The cursor is opaque to the client; inside it holds the position of the last item returned (for example its post ID, which is time-sortable).
High-level design
- The post service writes posts to a database sharded by post ID. Post IDs are 64-bit and time-sortable (timestamp in the high bits), so sorting by ID sorts by time.
- For media, clients upload to object storage with a pre-signed URL; a CDN serves images and video.
- The graph service stores follow edges in both directions (who I follow, who follows me), sharded by user ID.
- For fan-out, each new post puts a message on a queue. Workers read the author's follower list and prepend the post ID to each follower's feed list in a Redis cluster.
- The feed service reads the user's feed list of IDs, merges in recent posts from followed celebrity accounts and the user's own posts, fetches post content and author profiles from caches (hydration), ranks if needed, and returns a page with a cursor.
- Like and comment counts live in their own store and are attached at hydration time, so a like does not rewrite any feed.
Deep dive 1: fan-out on write vs read
| Fan-out on write (push) | Fan-out on read (pull) | Hybrid | |
|---|---|---|---|
| How it works | On post, write the ID into every follower's feed list | On read, fetch recent posts from everyone the user follows and merge | Push for normal authors; pull at read time for authors above a follower threshold |
| Read cost | One list read: fast | Many queries per feed load: slow for users who follow hundreds | One list read plus a few celebrity lookups |
| Write cost | Followers x posts; huge for celebrities | One write per post | Bounded: big accounts are not fanned out |
| Freshness | Seconds of fan-out lag | Always current | Current for celebrities, seconds for others |
| Wasted work | Writes into feeds of users who never log in | None | Can skip fan-out to inactive users |
| Good for | Most users, read-heavy products | Small systems, or as the fallback path | The usual interview answer at scale |
Pick a threshold with a reason, for example "authors with more than 100,000 followers are pulled", and say it is tuned from data. Also skip pushing to users who have not opened the app in weeks; rebuild their feed with the pull path when they return.
Deep dive 2: feed storage, pagination and consistency
Each feed list holds post IDs only, capped at a few hundred entries. Post bodies live in a post cache keyed by ID. This keeps feeds small, and an edited or deleted post is fixed in one place.
Paginate with a cursor. With page numbers, a new post at the top shifts everything down and the user sees duplicates on the next page. A cursor holds the last post ID seen, and the next request asks for items older than that ID.
Fan-out takes seconds, but users expect to see their own post at once, so merge the user's recent posts into their feed at read time.
For deletes and privacy changes, do not try to remove a post from millions of lists. At hydration time, skip posts that are deleted or no longer visible to this user. Stale IDs age out as the list is capped.
After an unfollow, either filter at read time against the current follow set, or accept that old posts from that author remain until they scroll off. Say which.
Deep dive 3: ranking (if asked)
A chronological feed needs no extra step. A ranked feed usually works in stages: gather candidates (the feed list, pulled celebrity posts, maybe recommended posts), fetch features (author affinity, post age, engagement so far), score with a model, then re-rank for variety so one author does not fill the screen. Keep this part short in a backend design round unless the interviewer pushes. The ML-flavored version of this question is a separate round in our data (18 reports, mostly Meta).
Scaling and failure modes
| Problem | What happens | What to do |
|---|---|---|
| Celebrity posts | Fan-out storm of tens of millions of writes | Hybrid model: pull these authors at read time |
| Hot post reads | One post object is read by millions; one cache shard melts | Replicate hot keys across shards or cache them in the feed service's local memory for a few seconds |
| Fan-out backlog | Queue lag grows; posts appear minutes late | Monitor lag; prioritize active users; scale workers; skip inactive users |
| Feed cache loss | Feeds empty after a cache node fails | Rebuild on demand with the pull path; serve a slower feed instead of an error |
| Traffic spike during big events | Many identical cache misses hit the database at once | Request coalescing, so one miss fills the cache for all waiting requests |
| Hot database shard | One author's posts concentrated on one shard | Shard posts by post ID, not author ID; keep an author-to-posts index separately |
What interviewers look for: mid vs senior
Our guidance from how these rounds usually run, not a company rubric.
| Area | Mid-level answer | Senior answer |
|---|---|---|
| Requirements | Lists features and says read-heavy | Uses numbers to show why precomputing feeds pays and where pure push breaks |
| Fan-out | Describes push or pull | Chooses hybrid with a threshold and explains inactive users and lag |
| Data model | Posts table, follows table, feed cache | IDs-only feed lists, time-sortable IDs, sharding keys chosen on purpose |
| API | Correct endpoints | Cursor pagination with a reason, idempotent post creation, media upload outside the API servers |
| Edge cases | Mentions deletes | Read-your-own-post, deletes and privacy at hydration, unfollow semantics, hot keys |
Common mistakes
- Choosing pure push without handling accounts with millions of followers.
- Storing full post objects in every feed list.
- Offset or page-number pagination on a feed that changes every second.
- Spending half the round on the ranking model in a backend design round.
- Forgetting that the author should see their own post at once.
- Treating deletes as a fan-out job over millions of lists.
- Sending media through the API servers instead of straight to object storage and a CDN.
How to prepare
Memorize your numbers
Have one set of assumptions (users, posts, follows) and the reads per second, writes per second and cache size they imply. Reuse them in every practice run.
Practise the variants
Do the plain feed, feed plus post search (as in the LinkedIn report [3]), and scheduled posts (as in the xAI report [2]).
Draw it as text
If you interview at Meta, practise the design in a Markdown or Mermaid editor, since that is the official format [9].
Prepare one deep dive in full
Pick fan-out or pagination and be ready to spend ten minutes on it with failure cases.
Practise the news feed design
A mock interview that pushes on fan-out choices, the celebrity case and pagination.
Start free mockFAQ
Push or pull: which should I pick?
Hybrid for any realistic scale: push for normal authors, pull for accounts above a follower threshold. Explain the threshold with your numbers.
How many items should a feed cache hold per user?
A few hundred post IDs is a common choice. Most users never scroll past that; older items come from the pull path.
Do I need to design ranking?
Only if the interviewer asks for a ranked feed. Describe the stages (candidates, features, scoring, re-ranking) briefly. ML loops ask a separate feed-ranking design question.
Which companies ask it?
Mostly Meta in our data (15 of 20 single-company reports), plus one each from Pinterest, OpenAI, xAI and LinkedIn. Three reports are from the last 90 days [1][2][3].
Is 'design Twitter' the same question?
Largely. Twitter adds one-way follows with extreme follower counts and often search over posts. A Meta report from March 2026 asked for post, retrieve and search together [6].
How do I handle a deleted post?
Mark it deleted in the post store and skip it at hydration time. Do not try to remove it from every follower's feed list.
Sources
- Candidate report · PracHub: Meta E6, rejected after missing a bug in AI-assisted coding (news feed design in loop) · Nov 2026
- Candidate report · PracHub: xAI SWE, rejected after delayed-tweet system design · Sep 2026
- Candidate report · PracHub: LinkedIn senior SWE, failed post-search system design round · Sep 2026
- Candidate report · PracHub: OpenAI SWE, social media feed coding problem · Jul 2026
- Candidate report · Reddit r/leetcode: what big tech interviews are like beyond LeetCode (design Twitter) · Jul 11, 2026
- Candidate report · PracHub: Meta SWE, design Twitter (post, retrieve, search) · Mar 2026
- Candidate report · LeetCode Discuss: Meta E5 infra onsite, Instagram feed with fan-out · Dec 2025
- Candidate report · LeetCode Discuss: Meta E4, Facebook feed post design focused on API · Jun 2025
- Official · Meta Careers: hiring process FAQ (design interviews in CoderPad with Mermaid and AI assistant)
We quote briefly, never name posters, and correct errors on request: report an error.