WEEK 03 · 2026-08-10 · MON

FB News Feed:先盲做需求/API/HLD,再读 live 目录

把 feed 讲成“事实状态 + 派生 timeline”的问题,而不是一上来堆 cache、queue、ranking。

今日固定时间表

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

08:30 wake起床、早餐、准备白板;不安排预读或算法。
08:50—09:1008:50—10:55 system design
闭卷收敛 — 只写 FR/NFR/out-of-scope 和三条 API,拒绝先画组件。
09:10—09:4508:50—10:55 system design
精确原文 — 读 News Feed requirements/entity/API/HLD 到四个 HLD 子路径。
09:45—10:2508:50—10:55 system design
白板主路径 — 画 create post → durable post → fan-out event → feed read;补 cursor pagination。
10:25—10:5508:50—10:55 system design
DDIA 决策卡 — 把 read-your-writes 与 monotonic reads 绑定到作者刷新和分页 session。
14:30—16:15NeetCode Tag · Stack
三道题在下方独立算法表执行,避免系统设计表格挤压算法细节。
20:30—21:1520:30—21:15 口述 News Feed 0—15 分钟:需求、API、数据模型、HLD;录音后写一个 staleness repair sentence。

算法模块

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

#ProblemInvariant focus执行
1Valid Parentheses栈语义:每一步维护 unmatched opener 集合。35 分钟限时 + 5 分钟 invariant/bug risk
2Min Stack双栈/压缩最小值:查询不扫描历史。35 分钟限时 + 5 分钟 invariant/bug risk
3Evaluate Reverse Polish Notation表达式归约:操作数顺序是 bug 高发点。35 分钟限时 + 5 分钟 invariant/bug risk

闭卷起手

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

20 分钟闭卷画:createPost、follow、getFeed(cursor);写出 Post store、Follow graph、Feed table 各自谁拥有事实。

Hello Interview 精确目录

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

项目精确 section anchorDisposition今天怎么用
FB News FeedUnderstanding the Problemrequired readingclarify product surface and feed semantics
FB News FeedFunctional Requirementsrequired readingpost, follow/friend, view feed, page feed
FB News FeedNon-Functional Requirementsrequired readingavailability, bounded staleness, latency and large social graph
FB News FeedThe Set Uprequired readingcandidate framing before entities
FB News FeedPlanning the Approachrequired readingrequirements → entities → API → HLD sequencing
FB News FeedDefining the Core Entitiesrequired readingUser, Post, Follow, FeedItem
FB News FeedAPI or System Interfacerequired readingcreate post, follow/unfollow, get feed cursor
FB News FeedHigh-Level Designrequired readingread path and write path before deep dives
FB News Feed1. Users should be able to create posts.required readingwrite source-of-record post and emit fan-out event
FB News Feed2. Users should be able to friend/follow people.required readingfollow graph mutation and query access
FB News Feed3. Users should be able to view a feed of posts from people they follow.required readingfeed read API and derived timeline
FB News Feed4. Users should be able to page through their feed.required readingcursor semantics and stable ordering

DDIA 精确决策卡

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

项目问题精确 DDIA subsection改变的系统决定
News Feed 写入成功后,作者自己刷新 feed 为什么不能丢自己的新帖?Ch6 · 读己之写作者视角可走 read-your-writes path:新帖由 Post store 确认后直接合并进作者 feed,不能只等异步 fan-out。
分页时读副本落后会造成什么体验问题?Ch6 · 单调读同一 feed session 绑定 cursor/version,避免第 2 页看见比第 1 页更旧的世界。

今日产出与修复规则

课程角色CORE · requirements/API/data model/HLD
必须交付一页 News Feed HLD:Post/Follow 权威状态、FeedItem 派生状态、cursor 语义、作者读己之写路径。
修复规则如果 feed table 被描述成 source of truth,重画从 Post+Follow 重建 feed 的 replay 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.