WEEK 05 · 2026-08-28 · FRI

Robinhood:ordered market updates、order gateway 与 financial retry failure

Robinhood 的核心不是撮合交易所,而是把外部市场数据和外部 order API 变成可审计、可恢复、低延迟的客户状态。

今日固定时间表

三块窗口固定:08:50-10:55 系统设计,14:30-16:15 算法,20:30-21:15 口述。

08:50-09:2508:50-10:55 system design
25-35 分钟 attempt - 闭卷设计 live prices、create/cancel/list orders;先区分 order、execution、portfolio projection。
09:25-10:0508:50-10:55 system design
精确原文 - 读 Robinhood 全部 canonical headings,包括 background、HLD、3 个 deep dives 和 levels。
10:05-10:3508:50-10:55 system design
故障时序 - submit 到 exchange 成功但本地写 externalOrderId 失败;cancel retry;trade feed duplicate/out-of-order。
10:35-10:5508:50-10:55 system design
DDIA 决策卡 - 用 Ch8 distributed transactions/exactly-once 和 Ch10 shared logs 定义恢复边界。
14:30-16:15NeetCode Tag · Binary Search
三道题,每题 30m solve + 5m evidence,不能改 tag。
20:30-21:1520:30-21:15 Robinhood English recall outline + one duplicate order/cancel retry trace。

算法模块

连续 NeetCode Binary Search;每天 exactly 3 slots。

#Problem / modePatternInvariantBug riskTimeSpace
1Single Element in a Sorted Array
NEW · 30m solve + 5m evidence
pair parityBefore the single item, pairs start at even index; after it, parity flips.Checking mid^1 outside range or wrong parity branch.O(log n)O(1)
2Find Peak Element
NEW · 30m solve + 5m evidence
slope binary searchIf nums[mid] < nums[mid+1], a peak exists to the right.Reading mid+1 when mid is hi.O(log n)O(1)
3Successful Pairs of Spells and Potions
NEW · 30m solve + 5m evidence
lower_bound per querySorted potions make required threshold index monotonic.Multiplication overflow; ceil division error.O((m+n) log n)O(n)

Hello Interview 精确目录

保留 live canonical heading title;day page 使用 direct section anchors。

项目精确 canonical sectionDisposition今天怎么用
RobinhoodUnderstanding the Problemrequired readingbrokerage system, not an exchange
RobinhoodBackground: Financial Marketsrequired readingsymbol, market order, limit order, exchange interface
RobinhoodFunctional Requirementsrequired readinglive prices and order management
RobinhoodNon-Functional Requirementsrequired readingconsistent orders, low latency, limited exchange connections
RobinhoodThe Set Uprequired readingplan the interview path
RobinhoodPlanning the Approachrequired readingbuild by functional requirements then NFR deep dives
RobinhoodDefining the Core Entitiesrequired readingUser, Symbol, Order
RobinhoodThe APIrequired readingsymbol price, create order, cancel order, list orders
RobinhoodHigh-Level Designrequired readingsymbol service, order gateway, trade processor
Robinhood1) Users can see live prices of stocksrequired readinglive market update path
Robinhood2) Users can manage orders for stocksrequired readingorder create/cancel/read lifecycle
RobinhoodPotential Deep Divesdeep diveprice scale, order updates, order consistency
Robinhood1) How can the system scale up live price updates?deep divesymbol pub/sub, SSE fanout and subscription ownership
Robinhood2) How does the system track order updates?deep diveexternalOrderId to internal order/user mapping
Robinhood3) How does the system manage order consistency?deep divepending/submitted/filled/cancelled, cleanup and reconciliation
RobinhoodSome additional deep dives you might considerdeep diveexcess updates, order update push, historical portfolio data
RobinhoodWhat is Expected at Each Level?level expectationcalibrate hard/full project depth
RobinhoodMid-levellevel expectationfunctional price and order design
RobinhoodSeniorlevel expectationreal-time prices and consistent order workflow
RobinhoodStaff+level expectationdeep trade-offs with external exchange and failure recovery

DDIA 精确决策卡

只使用 Ch8 和 Ch10 中直接解决今天设计决定的小节。

项目项目问题精确 DDIA subsection改变的系统决定
RobinhoodWhat happens if order submission reaches the exchange but local persistence fails?Ch8 - 分布式事务We avoid pretending local DB plus exchange API is one ACID database; we persist pending intent first and reconcile via clientOrderId.
RobinhoodHow are repeated order/cancel messages processed safely?Ch8 - 恰好一次消息处理Idempotency keys and externalOrderId mapping make duplicate dispatch, webhook, and cleanup retries converge to one order state.
RobinhoodHow should ordered market updates be delivered to many clients?Ch10 - 共享日志作为共识A symbol update stream carries sequence/as-of time; UI applies monotonic updates and can drop stale/out-of-order messages.

三域 trace 任务

Winning transaction标出唯一线性化点:seat hold/sold、accepted bid at close、brokerage order/execution state。
Duplicate/retry failure给出 stable idempotency key、重复返回语义、旧 owner/stale version 被拒绝的证据。
Projection boundary说明哪些读可以陈旧:seat map、highest bid display、market price UI;哪些写不能陈旧。

本日 artifacts

项目脚本、音频、PDF 和 mock evidence 从当天直接打开。

今日产出、修复与英语 recall

课程角色FULL · original reading + 35m attempt/follow-up
必须交付Robinhood 35m attempt + follow-up:price stream sequence、order state machine、externalOrderId map、cleanup/reconciliation。
修复规则如果下单成功就直接更新持仓,重写 order -> execution -> portfolio projection 的状态链。
English recall
English recall: An order is intent, an execution is fact, and portfolio is a derived view.
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.