WEEK 03 · 2026-08-11 · TUE

FB News Feed:fan-out、celebrity skew、hot posts 与派生状态

完整覆盖 News Feed deep dives:大量 followees、大量 followers、热门 post cache;产出可面试的 hybrid fan-out。

今日固定时间表

08:30 wake 只保留起床;学习从 08:50 开始。三块窗口不互相挤占。

08:30 wake起床、早餐、准备白板;不安排预读或算法。
08:50—09:1508:50—10:55 system design
Bad/Good/Great 拆解 — 为三类 skew 各写一个 Bad、Good、Great,不用组件名糊弄。
09:15—09:5008:50—10:55 system design
精确原文 — 读 News Feed potential deep dives 与 level expectation。
09:50—10:2508:50—10:55 system design
机制化白板 — 画 async fan-out workers、celebrity pull merge、post cache replication、feed repair。
10:25—10:5508:50—10:55 system design
指标和 failure window — 补 fan-out lag、duplicate item、cache stampede、celebrity merge p99。
14:30—16:15NeetCode Tag · Stack
三道题在下方独立算法表执行,避免系统设计表格挤压算法细节。
20:30—21:1520:30—21:15 Staff 追问练习:celebrity 发帖、worker 重试、feed 重建、hot post 缓存雪崩。

算法模块

连续单一 NeetCode Stack tag;每天 3 题,14:30—16:15 完成。

#ProblemInvariant focus执行
4Generate Parentheses隐式栈 DFS:open/close 不变量。35 分钟限时 + 5 分钟 invariant/bug risk
5Daily Temperatures单调递减栈:等待更暖日期。35 分钟限时 + 5 分钟 invariant/bug risk
6Car Fleet按位置排序后的单调到达时间栈。35 分钟限时 + 5 分钟 invariant/bug risk

闭卷起手

先暴露自己的当前模型,再用 live headings 修正。

15 分钟闭卷回答:fan-out on read、fan-out on write、hybrid push/pull 分别在哪个用户分布下失败。

Hello Interview 精确目录

day 页面必须链接到具体 section anchors;周级 overview 不放小节链接。

项目精确 section anchorDisposition今天怎么用
FB News FeedPotential Deep Divesdeep divetransition from HLD to scale questions
FB News Feed1) How do we handle users who are following a large number of users?deep divefan-out on read and precomputed feed
FB News Feed2) How do we handle users with a large number of followers?deep divefan-out on write, async workers, hybrid celebrity pull
FB News Feed3) How can we handle uneven reads of Posts?deep divehot post cache and replicated hot-key reads
FB News FeedWhat is Expected at Each Level?level expectationcalibrate depth
FB News FeedMid-levellevel expectationbasic flow
FB News FeedSeniorlevel expectationtrade-offs, scale, failure
FB News FeedStaff+level expectationskew, operational rigor, principled simplification

DDIA 精确决策卡

只读能改变今天设计决定的小节。

项目问题精确 DDIA subsection改变的系统决定
Feed table 是事实还是派生状态?Ch13 · 维护派生状态Post 与 Follow graph 是事实;per-user feed rows 是可重建派生状态,因此要有 lag、replay、repair 指标。
fan-out worker 重试为什么必须幂等?Ch12 · 幂等性feed insert key 使用 (viewerId, postId),重复事件只刷新位置/score,不产生重复 feed item。
如何看见派生 feed 已经落后?Ch13 · 观察派生数据状态公开 per-shard fan-out lag、oldest unprocessed event、repair backlog,而不是只看 API p99。

今日产出与修复规则

课程角色CORE · all deep dives + Bad/Good/Great
必须交付News Feed deep-dive matrix:large followees / large followers / uneven reads,各含 Bad-Good-Great、recovery 和指标。
修复规则如果答案只是“用 Kafka + Redis”,必须补 event key、idempotent insert key、lag measurement 和 fallback read path。
Local study materials
Detailed lecture notes, audio, recall scripts, PDFs, Staff Q&A, and mock packs are archived locally and are intentionally not published on this site.