Design a Precomputed Feed Cache for Fast Facebook Cold Starts

Last updated: November 29, 2026

Quick Overview

Design a cache of precomputed, partially ranked feed stories per user so that when someone opens the Facebook app after hours away, the first screen of News Feed renders in well under a second.

Meta
System Design
Software Engineer
Meta
November 29, 2026
Software Engineer
System Design Round
System Design
Medium

0

0

0 solved


Design a cache of precomputed, partially ranked feed stories per user so that when someone opens the Facebook app after hours away, the first screen of News Feed renders in well under a second.

Feed ranking at Meta is computed on request and is expensive, while cold-start latency strongly affects engagement. The interviewer is checking whether you can mix precompute with online ranking, decide what to cache and when to refresh it, and keep cached content safe against deleted or privacy-changed posts.

What the Interviewer Expects
  • Identify the latency budget and which steps can be precomputed
  • Decide what is cached: candidate ids, scores, or rendered stories
  • Choose refresh triggers and predict who will open soon
  • Re-check privacy and deletion at serve time
  • Bound memory cost across billions of users
Key Topics to Cover
precomputation
feed ranking
cache freshness
privacy rechecks
memory budgeting
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How do you avoid precomputing for users who will not open the app today?
  • What is lost by serving scores computed hours ago?
  • How does this interact with the client's own on-device prefetch?
  • How do you test that this improves engagement and not just latency?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: on app open, return the first 10 to 20 stories fast, then continue with fully online-ranked stories for later pages. Never show a deleted post or one the viewer can no longer see.

**N...

High-Level Design

A feed precompute job runs per user ahead of predicted opens: it gathers candidates (friends' posts, groups, pages, recommended reels), runs a lighter ranking pass, and writes a list of `(story_id...


Submit Your Answer
Markdown supported