WEEK 06 · 2026-08-31 · MON

Payment System:PaymentIntent、ledger truth 与 idempotent charge HLD

先把支付系统讲成状态机和账本事实:API 超时只代表未知,不能代表失败。

今日固定时间表

只有三个学习窗口:08:50-10:55、14:30-16:15、20:30-21:15。section links 只放在本日页面。

08:50-10:55System design
闭卷画 PaymentIntent/Transaction/LedgerEntry;再读 Payment System 从 Understanding the Problem 到 High-Level Design,保留原文标题并写出 API 幂等键。
14:30-16:15NeetCode Linked List
三道连续题位,每题 30m solve + 5m pattern/invariant/bug/complexity evidence。
20:30-21:15Recall / Staff Q&A / Mock
英语 recall:explain why a charge retry returns the same PaymentIntent/Transaction result and why ACK/status is not network settlement.

算法模块

连续 NeetCode Linked List tag;每天恰好 3 个 slot。

#Problem / modePatternInvariantBug riskTimeSpace
1Reverse Linked List
NEW · 30m solve + 5m evidence
pointer reversalprev points to fully reversed prefix; curr begins untouched suffixlosing next before rewiringO(n)O(1)
2Merge Two Sorted Lists
NEW · 30m solve + 5m evidence
dummy head mergetail always points to sorted merged prefixforgetting to append remaining listO(n+m)O(1)
3Linked List Cycle
NEW · 30m solve + 5m evidence
Floyd fast/slowfast moves two steps; meeting implies cyclenull access on fast.nextO(n)O(1)

Hello Interview 精确目录

保留 live original titles;每行都有 canonical anchor 和 disposition。

项目精确 canonical sectionDisposition今天怎么用
Payment SystemUnderstanding the Problemrequired readingframe Stripe-like payment processing and the merchant/customer boundary
Payment SystemFunctional Requirementsrequired readinginitiate payment, accept card payment, expose status updates
Payment SystemNon-Functional Requirementsrequired reading10,000 TPS, security, durability, financial integrity
Payment SystemThe Set Uprequired readingmove from requirements to entities/API/HLD
Payment SystemDefining the Core Entitiesrequired readingMerchant, PaymentIntent, Transaction, ledger entries
Payment SystemAPI or System Interfacerequired readingidempotent create/charge/status APIs
Payment SystemHigh-Level Designrequired readingPaymentIntent service, Transaction service, external network boundary
Payment System1) Merchants should be able to initiate payment requestsrequired readingPaymentIntent creation and idempotency key
Payment System2) Users should be able to pay for products with credit/debit cards.required readingauthorization path and card-token boundary
Payment System3) The system should provide status updates for paymentsrequired readingcurrent status versus event history

DDIA 精确决策卡

只读 Ch8、Ch12、Ch13 中能改变今天设计选择的小节。

项目问题精确 DDIA subsection改变的系统决定
Payment timeout/retry cannot double-charge a customerCh8 · ACID 的含义ledger state transition is transactional; card-network uncertainty stays pending
Payment API retry needs effect-once semanticsCh8 · 恰好一次消息处理store idempotency key with the state transition; broker exactly-once is not the proof

本日项目 artifacts

今日产出、修复与英语 recall

必须交付Payment HLD:PaymentIntent 状态机、Transaction 尝试、double-entry LedgerEntry、idempotency table、pending/reconciliation path。
修复规则如果回答只说组件名,重写为 decision -> mechanism -> invariant -> failure window -> recovery -> metric。
English recall
Correctness is the durable source of truth; low-latency status, aggregates, dashboards, and alerts are views with freshness and repair semantics.
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.