第 7 周 - 第 7 天 - 2026-09-13 SUN - SYNTHESIS - writer gate

Week 7 synthesis: replay, derived views, idempotency, operations gate

08:50-10:55 system design14:30-16:15 Trees x320:30-21:15 recall

今日目标

把 YouTube, Top K, Strava 收敛为一个机制地图:truth, derived views, replay, stale tolerance, idempotency, metrics.

08:50-09:00Set target
写下本周一句话:publication truth and view/activity truth are not the same as derived views.
09:00-10:05Weakest answer repair
重做 YouTube or Top K or Strava 最弱答案;必须包含 invariant, failure window, recovery, metrics.
10:05-10:45Synthesis
完成 Week 7 mechanism map and DDIA question-to-section recap.
10:45-10:55Spoken close
英文 2 分钟:replay and stale derived views across all three systems.
14:30-16:15NeetCode Trees
Exactly three contiguous Trees slots. Each slot is 30m solve + 5m pattern/invariant/bug/complexity evidence.
20:30-21:15Recall / Q&A / repair
20:30-21:15 填 scorecard,确认 assets, links, visual smoke, and READY_FOR_REVIEW.

Exact source links

Use original Hello Interview titles and current canonical anchors. Inline Bad/Good/Great headings without standalone live anchors link to their parent canonical section.

Original title / direct linkDispositionUse
Week 7 Scorecardacceptanceevidence gate
Week 7 Production Recordrecordcoverage and validation evidence

DDIA decision cards

Only exact Ch11/Ch12/Ch13 sections that change today's design are assigned.

DDIA Ch13

批处理与流处理

Question: 批处理和流处理在 Week 7 怎么组合?

历史回填用 batch,近实时 view/activity 用 stream;读端统一看派生视图。

DDIA Ch13

维护派生状态

Question: 派生状态为什么允许短暂陈旧?

publication truth、view truth、activity truth 与 CDN/TopK/feed 派生视图分离。

DDIA Ch13

应用演化后重新处理数据

Question: 重新处理旧事件时如何避免破坏当前线上榜单?

重处理写新版本视图,验证后原子切换 alias/cache key。

DDIA Ch13

物化视图和缓存

Question: 缓存和物化视图 stale 到什么程度可接受?

CDN manifest、TopK cache、activity feed 都需要 TTL/freshness/SLO,而不是假装强一致。

DDIA Ch13

抑制重复

Question: 如何把重复请求压成一次操作?

client request id、upload chunk fingerprint、activity sample id、view event id 都是重复抑制键。

算法模块

Contiguous live NeetCode Trees order. No reviews. Three slots per day.

#Problem / modePatternInvariantBug riskTimeSpace
19Binary Tree Longest Consecutive Sequence
NEW - 30m solve + 5m evidence
DFS 传递长度child.val == parent.val + 1 时延长,否则重置。没有在断链处重置为 1。O(n)O(h)
20Binary Tree Longest Consecutive Sequence II
NEW - 30m solve + 5m evidence
后序递增/递减链节点可连接一条递减链和一条递增链。只保留单方向导致漏过拐点。O(n)O(h)
21Count Univalue Subtrees
NEW - 30m solve + 5m evidence
后序布尔返回子树全同值要求左右子树全同且子节点值匹配 root。空子树应视为满足条件。O(n)O(h)

今日验收

OutputScorecard, synthesis map, repaired spoken answer, production record gate.
Hard failPassive reading without a spoken answer; missing invariant/failure/recovery/metric; any day outside Week 7 touched.
RepairPick the weakest answer and redo it for 8 minutes with one new failure window.
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.