今日固定时间表
08:30 wake 只保留起床;学习从 08:50 开始。三块窗口不互相挤占。
| 08:30 wake | 起床、早餐、准备白板;不安排预读或算法。 |
|---|---|
| 08:50—09:10 | 08:50—10:55 system design 闭卷 HLD — 先定义 Document、Operation、Revision、Session、Presence。 |
| 09:10—09:45 | 08:50—10:55 system design 精确原文 — 读 Google Docs requirements/API/HLD 与 Collaborative Edits Breakdown。 |
| 09:45—10:25 | 08:50—10:55 system design 机制化白板 — snapshot + op log;submit op 带 baseRevision;服务端 sequencer 分配 new revision;客户端 transform/rebase。 |
| 10:25—10:55 | 08:50—10:55 system design DDIA 决策卡 — 多主冲突、本地优先实时协作和 CRDT/OT 的设计影响。 |
| 14:30—16:15 | NeetCode Tag · Sliding Window 三道题在下方独立算法表执行。 |
| 20:30—21:15 | 20:30—21:15 Google Docs 英语 recall:operation log、base revision、concurrent edits、presence。 |
算法模块
连续单一 NeetCode Sliding Window tag;每天 3 个 NEW slot,每题 30 分钟作答 + 5 分钟证据,正好 105 分钟。每天 timed review = 0,满足不超过 1。
| # | Problem / mode | Pattern | Invariant | Bug risk | Time | Space |
|---|---|---|---|---|---|---|
| 7 | Max Consecutive Ones II NEW · 30m solve + 5m evidence | 至多一个零的可变窗口 | 窗口内 zeroCount <= 1。 | 第三个零后只缩一次而非缩到合法。 | O(n) | O(1) |
| 8 | Longest Substring with At Most Two Distinct Characters NEW · 30m solve + 5m evidence | 至多 K 类字符窗口 | count 中正频次字符数 <= 2。 | 频次归零后未删除 key。 | O(n) | O(1) alphabet |
| 9 | Longest Substring with At Most K Distinct Characters NEW · 30m solve + 5m evidence | 至多 K 类字符窗口 | 收缩结束后 distinct <= k。 | k=0;删除左字符时漏减 distinct。 | O(n) | O(k) |
闭卷起手
20 分钟闭卷画 loadDocument、submitOperation、subscribeOps、updateCursor;写出 LWW 为什么丢用户意图。
Hello Interview 精确目录
day 页面使用 canonical data-toc-id/H4 anchors;周级 overview 不放小节链接。
| 项目 | 精确 canonical section | Disposition | 今天怎么用 |
|---|---|---|---|
| Google Docs | Understanding the Problem | required reading | collaborative document surface |
| Google Docs | Functional Requirements | required reading | documents, concurrent edits, realtime changes, presence |
| Google Docs | Non-Functional Requirements | required reading | latency, availability, consistency boundary |
| Google Docs | Set Up | required reading | scope and simplifications |
| Google Docs | Planning the Approach | required reading | entities/API/HLD sequence |
| Google Docs | Defining the Core Entities | required reading | Document, Operation, Revision, Session, Presence |
| Google Docs | Defining the API | required reading | load document, submit op, subscribe, cursor |
| Google Docs | High-Level Design | required reading | document service + op log + websocket broadcast |
| Google Docs | 1) Users should be able to create new documents. | required reading | document metadata and initial revision |
| Google Docs | 2) Multiple users should be able to edit the same document concurrently. | required reading | concurrent operation semantics |
| Google Docs | 3) Users should be able to view each other's changes in real-time. | required reading | operation broadcast and replay |
| Google Docs | 4) Users should be able to see the cursor position and presence of other users. | required reading | soft presence, not durable truth |
| Google Docs | Collaborative Edits Breakdown | deep dive | H4 breakdown of edit path |
DDIA 精确决策卡
只读能改变今天设计决定的小节。
| 项目问题 | 精确 DDIA subsection | 改变的系统决定 |
|---|---|---|
| Google Docs 多人并发编辑为什么不是简单 last-write-wins? | Ch6 · 处理写入冲突 | 文档编辑必须保留用户意图,不能用 LWW 丢弃并发操作;需要 OT/CRDT 或服务端 sequencer。 |
| 协同编辑的浏览器副本为什么像多主复制? | Ch6 · 实时协作、离线优先和本地优先应用 | 本地先应用,异步同步到其他客户端;必须显式处理冲突、回放和撤销。 |
本日项目 artifacts
脚本、音频、PDF 与 mock evidence 直接从对应日打开。
今日产出、修复与英语 recall
| 课程角色 | CORE · requirements/API/data model/HLD |
|---|---|
| 必须交付 | Google Docs HLD:Document snapshot、Operation log、baseRevision、ack/rebase、presence/cursor state。 |
| 修复规则 | 如果用 last write wins 覆盖整篇文档,补 OT/CRDT 或服务端 sequencer 如何保留用户意图。 |
| English recall | English recall: “Collaborative editing stores intent-preserving operations, not just the latest document blob.” |
Detailed lecture notes, audio, recall scripts, PDFs, Staff Q&A, and mock packs are archived locally and are intentionally not published on this site.