今日固定时间表
08:30 wake 只保留起床;学习从 08:50 开始。三块窗口不互相挤占。
| 08:30 wake | 起床、早餐、准备白板;不安排预读或算法。 |
|---|---|
| 08:50—09:10 | 08:50—10:55 system design 闭卷收敛 — FR/NFR/out-of-scope;先定义 per-conversation ordering,不承诺全局总序。 |
| 09:10—09:45 | 08:50—10:55 system design 精确原文 — 读 WhatsApp 到 HLD 四个功能路径。 |
| 09:45—10:25 | 08:50—10:55 system design 白板主路径 — client_message_id → conversation sequencer → durable message → fanout/mailbox → device receipt。 |
| 10:25—10:55 | 08:50—10:55 system design DDIA 决策卡 — 把 logical timestamp/happens-before 绑定到消息顺序、离线重连和重复投递。 |
| 14:30—16:15 | NeetCode Tag · Sliding Window 三道题在下方独立算法表执行。 |
| 20:30—21:15 | 20:30—21:15 WhatsApp 英语 recall + 中文 Q&A:ordering guarantee、offline delivery、multi-device receipts。 |
算法模块
连续单一 NeetCode Sliding Window tag;每天 3 个 NEW slot,每题 30 分钟作答 + 5 分钟证据,正好 105 分钟。每天 timed review = 0,满足不超过 1。
| # | Problem / mode | Pattern | Invariant | Bug risk | Time | Space |
|---|---|---|---|---|---|---|
| 1 | Contains Duplicate II NEW · 30m solve + 5m evidence | 固定最大跨度窗口 + set | set 只保存与当前 index 距离不超过 k 的值。 | 先查后删会漏掉边界 k;k=0。 | O(n) | O(k) |
| 2 | Best Time to Buy and Sell Stock NEW · 30m solve + 5m evidence | 单调左状态 | 右指针处只需要左侧最低价格。 | 先更新 min 再算利润;递减数组。 | O(n) | O(1) |
| 3 | Minimum Recolors to Get K Consecutive Black Blocks NEW · 30m solve + 5m evidence | 固定长度计数窗口 | 窗口始终恰含 k 个 block,并维护 white 数。 | 第 k 个元素加入时 off-by-one;k=n。 | O(n) | O(1) |
闭卷起手
20 分钟闭卷画 sendMessage、syncMessages、ackReceipt、setPresence;写清 sent/delivered/read 分别代表什么。
Hello Interview 精确目录
day 页面使用 canonical data-toc-id/H4 anchors;周级 overview 不放小节链接。
| 项目 | 精确 canonical section | Disposition | 今天怎么用 |
|---|---|---|---|
| Understanding the Problem | required reading | scope: 1:1/group messaging, delivery and presence | |
| Functional Requirements | required reading | groups, messages, offline delivery, media | |
| Non-Functional Requirements | required reading | scale, durability, latency, eventual delivery | |
| The Set Up | required reading | candidate framing | |
| Planning the Approach | required reading | requirements → entities → API → HLD | |
| Defining the Core Entities | required reading | User, Device, Chat, Message, Receipt, Presence | |
| API or System Interface | required reading | send, sync, receipts, presence | |
| High-Level Design | required reading | connection gateway + durable log + fanout | |
| 1) Users should be able to start group chats with multiple participants (limit 100) | required reading | group membership and chat ownership | |
| 2) Users should be able to send/receive messages. | required reading | durable accept and delivery pipeline | |
| 3) Users should be able to receive messages sent while they are not online (up to 30 days). | required reading | mailbox/sync cursor and retention | |
| 4) Users should be able to send/receive media in their messages. | required reading | media pointer; not Week 4 main bottleneck |
DDIA 精确决策卡
只读能改变今天设计决定的小节。
| 项目问题 | 精确 DDIA subsection | 改变的系统决定 |
|---|---|---|
| WhatsApp 发送 ACK 到底代表消息处于哪个顺序点? | Ch10 · 逻辑时钟 | conversation 内 sequence/logical timestamp 由服务端分配;不使用客户端日历时钟决定消息顺序。 |
| 离线设备重连时如何判断哪些消息先发生、哪些是重复? | Ch6 · “先发生”关系与并发 | 设备保存 last applied cursor;按 conversation sequence 补缺口,messageId/clientMessageId 幂等应用。 |
本日项目 artifacts
脚本、音频、PDF 与 mock evidence 直接从对应日打开。
今日产出、修复与英语 recall
| 课程角色 | CORE · requirements/API/data model/HLD |
|---|---|
| 必须交付 | WhatsApp HLD:Chat/Message/DeviceDelivery/Receipt/Presence schema、发送 ACK 语义、离线 sync cursor。 |
| 修复规则 | 如果 ACK 被说成对方已读,重写 sent/durable/delivered/read 四种状态。 |
| English recall | English recall: “A send ACK means the server durably accepted the message, not that every recipient has read it.” |
Detailed lecture notes, audio, recall scripts, PDFs, Staff Q&A, and mock packs are archived locally and are intentionally not published on this site.