WEEK 04 · 2026-08-21 · FRI

Online Chess:先盲做,再迁移 messaging/collaboration 的可复用与失效假设

把 Online Chess 当迁移题:可复用连接、房间、事件日志;不可复用聊天的 eventual ordering,也不可复用文档的保留冲突分支。

今日固定时间表

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

08:30 wake起床、早餐、准备白板;不安排预读或算法。
08:50—09:2008:50—10:55 system design
盲做 — 不看原文,先画权威 game server、move sequencer、server clock、reconnect snapshot。
09:20—09:5008:50—10:55 system design
精确原文 — 读 Online Chess visible live inventory 全部 anchors,包括 H4 matchmaking failure subheadings。
09:50—10:2508:50—10:55 system design
迁移差异 — changed requirements、invalid reuse assumptions、new bottlenecks、浅层迁移追问。
10:25—10:5508:50—10:55 system design
transfer close — 输出 8 分钟 Online Chess transfer answer:ordering、clock fairness、game server ownership。
14:30—16:15NeetCode Tag · Sliding Window
三道题在下方独立算法表执行。
20:30—21:1520:30—21:15 Online Chess 迁移口述:先讲盲做版本,再讲读完 live heading 后改了什么。

算法模块

连续单一 NeetCode Sliding Window tag;每天 3 个 NEW slot,每题 30 分钟作答 + 5 分钟证据,正好 105 分钟。每天 timed review = 0,满足不超过 1。

#Problem / modePatternInvariantBug riskTimeSpace
13Longest Repeating Character Replacement
NEW · 30m solve + 5m evidence
预算型可变窗口windowLen - maxFreq <= k 时窗口可统一。误以为收缩时必须降低陈旧 maxFreq。O(n)O(alphabet)
14Permutation in String
NEW · 30m solve + 5m evidence
固定频次匹配窗口窗口长度等于 pattern 且频次差为零。移出字符顺序错误;空/短字符串。O(n + m)O(alphabet)
15Frequency of the Most Frequent Element
NEW · 30m solve + 5m evidence
排序 + 成本窗口target*len - windowSum <= k。乘法溢出;收缩后未更新 windowSum。O(n log n)O(n) sort-dependent

闭卷起手

30 分钟盲做:matchmaking、game room、submitMove、clock、leaderboard。写下哪些 WhatsApp/Docs 假设会失效。

Hello Interview 精确目录

day 页面使用 canonical data-toc-id/H4 anchors;周级 overview 不放小节链接。

项目精确 canonical sectionDisposition今天怎么用
Online ChessUnderstanding the Problemrequired readingtransfer problem, blind first
Online ChessFunctional Requirementsrequired readingmatchmaking, realtime game, leaderboard
Online ChessNon-Functional Requirementsrequired readingfair clock, scale, low latency
Online ChessThe Set Uprequired readingscope and simplifications
Online ChessPlanning the Approachrequired readingrequirements → entities → API → HLD
Online ChessDefining the Core Entitiesrequired readingPlayer, Game, Move, Clock, MatchmakingPool
Online ChessAPI or System Interfacerequired readingjoin queue, submit move, watch game, leaderboard
Online ChessHigh-Level Designrequired readinggame server as authoritative sequencer
Online Chess1) Players should be able to find an opponent through skill-based matchmaking and start a gamerequired readingtransfer from connection queues with stronger fairness
Online Chess2) Players should be able to play a game in real timerequired readingauthoritative move ordering
Online Chess3) Players should be able to view a global leaderboard and see their own rankrequired readingderived ranking state
Online ChessPotential Deep Divesdeep divetransfer pressure
Online Chess1) How do we match players fairly at scale?deep divefair queue, rating windows, pool sharding
Online ChessDo we need to shard the pool across Redis nodes?deep diveH4 matchmaking pool sharding
Online ChessWhat happens if that Redis node goes down?deep diveH4 recovery for queue ownership
Online Chess2) How do we scale the game servers to 500K concurrent games?deep diveroom placement and state ownership
Online Chess3) How do we keep the clock fair despite uneven latency?deep diveserver clock and process-pause hazards
Online Chess4) How do we keep the leaderboard correct and fast at 10M players?deep divederived ranking with authoritative game results
Online ChessSome additional deep dives you might considerdeep diveextra transfer prompts
Online ChessWhat is Expected at Each Level?level expectationcalibrate transfer depth
Online ChessMid-levellevel expectationbasic game flow
Online ChessSeniorlevel expectationcorrectness and scale
Online ChessStaff+level expectationfairness, clocks, failover, cheat boundaries

DDIA 精确决策卡

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

项目问题精确 DDIA subsection改变的系统决定
Online Chess 为什么不能照搬聊天的 eventual ordering?Ch10 · 线性一致性每盘棋的 move 必须像单对象线性化:同一 move number 只能有一个权威结果。
棋钟公平为什么不能相信客户端倒计时?Ch9 · 对同步时钟的依赖客户端时钟只用于显示;超时裁决由服务器事件时间和可审计 deadline 决定。

本日项目 artifacts

脚本、音频、PDF 与 mock evidence 直接从对应日打开。

今日产出、修复与英语 recall

课程角色TRANSFER · blind first then live-source read
必须交付Online Chess transfer memo:changed requirements、invalid reuse assumptions、new bottlenecks、shallow-transfer follow-ups。
修复规则如果把棋局 move 当聊天消息队列,补 server-side legal move validation、single authoritative move number、clock裁决。
English recall
English recall: “Chess moves require authoritative validation and a single accepted move order per game.”
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.