> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# News Feed Requirements and Estimation

> Designing a scalable social news feed for interview problems, detailing functional and non functional requirements, traffic estimation, read heavy trade offs, caching and fan out strategies.

Let's design a news feed for an interview question. Be precise about what "news feed" means: in interviews it's the main, scrollable list of posts or items you see on the first screen of a social app—not the whole app. Examples:

* On LinkedIn the first screen shows posts from people you follow — that is its news feed.
* On X (formerly Twitter) the first screen shows tweets from accounts you follow — that is its news feed.

A feed is a sorted list of posts that users can endlessly scroll. Our job is to design a system that efficiently builds and serves that list under realistic constraints.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/CjAdnUFCNZoN2k5-/images/System-Design-for-Interview-Prep/Fan-Out-One-Event-Many-Readers/News-Feed-Requirements-and-Estimation/dark-news-feed-smartphone-mockup.jpg?fit=max&auto=format&n=CjAdnUFCNZoN2k5-&q=85&s=8c192e4bfa955772fa0e3fa438189f84" alt="A centered smartphone mockup shows a dark-themed social media/news feed with posts, icons, and a small image thumbnail. The words &#x22;News Feed&#x22; are displayed above on a black background." width="1920" height="1080" data-path="images/System-Design-for-Interview-Prep/Fan-Out-One-Event-Many-Readers/News-Feed-Requirements-and-Estimation/dark-news-feed-smartphone-mockup.jpg" />
</Frame>

We’ll follow a six-step framework, beginning with clarifying requirements. At this stage, gather the minimum set of functional and non-functional requirements needed to scope the design.

Step 1 — Clarify requirements

1. What goes into the feed and how is it ordered?
   * If the interviewer limits the feed to posts from accounts a user follows and asks for newest-first ordering, the problem reduces to timestamp-based sorting. If instead a ranking algorithm is required, that becomes a larger ranking problem that needs signals (post age, creator relationship, likes/reactions, engagement, etc.) and an online or offline scoring pipeline.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/CjAdnUFCNZoN2k5-/images/System-Design-for-Interview-Prep/Fan-Out-One-Event-Many-Readers/News-Feed-Requirements-and-Estimation/dark-dashboard-ranking-maya-rao-notes.jpg?fit=max&auto=format&n=CjAdnUFCNZoN2k5-&q=85&s=7dc14e1bd0a99718d0d8746f052b55b9" alt="A dark-themed dashboard showing a ranking panel with users (Maya Rao top with a score of 88, followed by John Marsh and Leo Abbas) and a &#x22;Your Notes&#x22; sidebar. At the bottom are small &#x22;Interviewer&#x22; and &#x22;You&#x22; icons." width="1920" height="1080" data-path="images/System-Design-for-Interview-Prep/Fan-Out-One-Event-Many-Readers/News-Feed-Requirements-and-Estimation/dark-dashboard-ranking-maya-rao-notes.jpg" />
</Frame>

2. How quickly must a new post appear in followers' feeds?
   * Example: "A few seconds is fine; it shouldn't take minutes."

3. What is the target feed load latency?
   * Example: "The feed should load within 1 second on open."

4. Which content types should the feed support?
   * Example: "Text, images, and videos."

5. Is occasional duplication after refresh acceptable?
   * Example: "Yes — occasional duplicates after a refresh are acceptable."

Scope for this example (explicitly state what we will design):

* Users can follow other accounts.
* Users create posts that include text, images, or videos.
* The feed shows the newest posts only from accounts a user follows.
* Feed must load within 1 second on open.
* A new post should reach followers within a few seconds.
* Occasional duplicate posts on refresh are acceptable.

Use this table to summarize functional and non-functional requirements:

| Requirement type | Requirement | Example / Notes |
| - | - | - |
| Functional | Source of feed items | Only posts from accounts a user follows |
| Functional | Ordering | Newest first (timestamp-based) |
| Functional | Content types | `text`, images, videos |
| Non-functional | Feed load latency | Load feed ≤ 1 second |
| Non-functional | Propagation latency | New post visible to followers within a few seconds |
| Non-functional | Consistency | Eventual consistency acceptable; occasional duplicates fine |

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/CjAdnUFCNZoN2k5-/images/System-Design-for-Interview-Prep/Fan-Out-One-Event-Many-Readers/News-Feed-Requirements-and-Estimation/dark-ui-phone-feed-loads-1s.jpg?fit=max&auto=format&n=CjAdnUFCNZoN2k5-&q=85&s=be696725ca96ada76e1df1799ae0e03e" alt="A dark-themed UI mockup showing a smartphone screen with a progress bar reading &#x22;1.0 s&#x22; while the feed loads. On the right is a &#x22;Your Notes&#x22; list of numbered requirements, with &#x22;#3 THE FEED LOADS IN ONE SECOND&#x22; highlighted." width="1920" height="1080" data-path="images/System-Design-for-Interview-Prep/Fan-Out-One-Event-Many-Readers/News-Feed-Requirements-and-Estimation/dark-ui-phone-feed-loads-1s.jpg" />
</Frame>

Step 2 — Back-of-the-envelope estimation

Ask about scale: how many users, how often do they open the feed, how frequently do they post? Example assumptions below produce a realistic read-heavy workload and will guide architecture choices (caching, pre-computation, and fan-out).

Assumptions

* Daily active users (DAU): 10,000,000
* Average opens per user per day: 5
* Average posts per user per month: 3

Calculations

* Feed reads/day = 10,000,000 × 5 = 50,000,000 reads/day
* Seconds per day = 86,400 → reads/sec ≈ 50,000,000 / 86,400 ≈ 580 reads/sec
* Total posts/month = 10,000,000 × 3 = 30,000,000 posts/month
* Posts/day ≈ 30,000,000 / 30 ≈ 1,000,000 posts/day
* Writes/sec ≈ 1,000,000 / 86,400 ≈ 12 writes/sec
* Read : write ratio ≈ 580 : 12 ≈ 48 : 1 (≈ 50 reads per write)

Summarized in a table:

| Metric | Value |
| - | - |
| DAU | 10,000,000 |
| Opens per user / day | 5 |
| Reads/day | 50,000,000 |
| Reads/sec (avg) | ≈ 580 |
| Posts/month | 30,000,000 |
| Posts/day | 1,000,000 |
| Writes/sec (avg) | ≈ 12 |
| Read : write ratio | ≈ 48 : 1 |

These numbers show the system is read‑heavy. That should drive design decisions: favor low-latency read paths, caching, and pre-computation (fan-out strategies) over write-optimized designs.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/CjAdnUFCNZoN2k5-/images/System-Design-for-Interview-Prep/Fan-Out-One-Event-Many-Readers/News-Feed-Requirements-and-Estimation/estimate-10m-users-read-write-rates.jpg?fit=max&auto=format&n=CjAdnUFCNZoN2k5-&q=85&s=b1d00c518f97f586b05b827af20e3c36" alt="A dark-themed slide estimating traffic for 10,000,000 daily users, showing read/write math (5 opens/day → 50,000,000 reads/day = 600 reads/sec; 3 posts/month → 1,000,000 writes/day = 12 writes/sec). The screen is labeled &#x22;Estimate&#x22; and highlights read/write rates." width="1920" height="1080" data-path="images/System-Design-for-Interview-Prep/Fan-Out-One-Event-Many-Readers/News-Feed-Requirements-and-Estimation/estimate-10m-users-read-write-rates.jpg" />
</Frame>

<Callout icon="lightbulb" color="#1CB2FE">
  The key takeaway from estimation: the feed is read-heavy. Prioritize fast read paths (caching and pre-computation/fan-out) and acceptable eventual consistency. Use the read/write ratio to justify design trade-offs during your interview.
</Callout>

Next steps in the six-step framework (not covered here) would include choosing a high-level architecture (push vs. pull fan-out), designing data models for posts and user relationships, defining storage and caching layers, and outlining operational concerns (monitoring, throttling, and backpressure). For reference and deeper study, consider these resources:

Links and References

* [Kubernetes Documentation](https://kubernetes.io/docs/) — for running scalable services
* [System design primer on GitHub](https://github.com/donnemartin/system-design-primer) — good interview prep and patterns
* [Designing data-intensive applications (book)](https://www.oreilly.com/library/view/designing-data-intensive-applications/9781491903063/) — background on storage and replication patterns

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/system-design-for-interview-prep/module/36e67187-d5c7-44a8-9c92-65e2548b2f80/lesson/a4870887-3ff9-4c08-938d-b2263a6c24d1" />
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.