第 7 周 - 第 5 天 - 2026-09-11 FRI - TRANSFER - Strava

Strava TRANSFER: blind activity ingestion, offline replay, stale derived views

08:50-10:55 system design14:30-16:15 Trees x320:30-21:15 recall

今日目标

先盲做 Strava,再比较 YouTube/Top K 的可复用与失效假设:activity truth lives on device first, then syncs to backend.

08:50-09:00Set target
闭卷写 transfer hypothesis: 从 YouTube/Top K 能复用什么,什么会错?
09:00-10:05Blind design then read
35 分钟 Strava blind design;之后读 current live headings through available deep dives.
10:05-10:45Delta artifact
填写 delta, invalid assumptions, new bottleneck, follow-up that exposes shallow transfer.
10:45-10:55Spoken close
英文解释 offline activity local log, replay, idempotent sync, and stale derived feed tolerance.
14:30-16:15NeetCode Trees
Exactly three contiguous Trees slots. Each slot is 30m solve + 5m pattern/invariant/bug/complexity evidence.
20:30-21:15Recall / Q&A / repair
20:30-21:15 朗读 Strava transfer script and repair one invalid reused assumption.

Exact source links

Use original Hello Interview titles and current canonical anchors. Inline Bad/Good/Great headings without standalone live anchors link to their parent canonical section.

Original title / direct linkDispositionUse
Understanding the Problemblind-read-after-attemptfitness activity tracking surface
Functional Requirementsblind-read-after-attemptstart/pause/stop/save, local stats, activity details
Non-Functional Requirementsblind-read-after-attemptavailability, offline use, accurate local stats, 10M concurrent activities
The Set Upblind-read-after-attemptscope and simplification
Defining the Core Entitiesblind-read-after-attemptUser, Activity, Route, Friend
The APIblind-read-after-attemptactivity state, routes, list and detail APIs
High-Level Designblind-read-after-attemptclient-server baseline
1) Users should be able to start, pause, stop, and save their runs and rides.blind-read-after-attemptactivity state log and pause semantics
2) While running or cycling, users should be able to view activity data, including route, distance, and time.blind-read-after-attemptlocal route/distance computation
3) Users should be able to view details about their own completed activities as well as the activities of their friends.blind-read-after-attemptcompleted activity list/detail views
Potential Deep Divestransfer pressureoffline, scale, realtime sharing, leaderboard
1) How can we support tracking activities while offline?transfer pressureclient local buffer, periodic persistence, sync
2) How can we scale to support 10 million concurrent activities?transfer pressureoffload live writes to client, large route storage
3) How can we support realtime sharing of activities with friends?transfer pressurepolling/buffering instead of WebSocket by default
4) How can we expose a leaderboard of top athletes?transfer pressurederived leaderboard state; current live page gates details behind premium

DDIA decision cards

Only exact Ch11/Ch12/Ch13 sections that change today's design are assigned.

DDIA Ch12

重播旧消息

Question: Top K view event 可以 replay 吗,怎么不重复计算?

Kafka/Flink replay 用 offset/checkpoint;聚合更新必须按 eventId/window/videoId 幂等。

DDIA Ch13

批处理与流处理

Question: 批处理和流处理在 Week 7 怎么组合?

历史回填用 batch,近实时 view/activity 用 stream;读端统一看派生视图。

DDIA Ch13

维护派生状态

Question: 派生状态为什么允许短暂陈旧?

publication truth、view truth、activity truth 与 CDN/TopK/feed 派生视图分离。

DDIA Ch13

物化视图和缓存

Question: 缓存和物化视图 stale 到什么程度可接受?

CDN manifest、TopK cache、activity feed 都需要 TTL/freshness/SLO,而不是假装强一致。

DDIA Ch13

抑制重复

Question: 如何把重复请求压成一次操作?

client request id、upload chunk fingerprint、activity sample id、view event id 都是重复抑制键。

算法模块

Contiguous live NeetCode Trees order. No reviews. Three slots per day.

#Problem / modePatternInvariantBug riskTimeSpace
13Path Sum
NEW - 30m solve + 5m evidence
根到叶路径累加只有叶子节点才能判 remaining == value。在非叶节点提前返回 true。O(n)O(h)
14Range Sum of BST
NEW - 30m solve + 5m evidence
BST 剪枝 DFS低于 low 的左子树可跳过,高于 high 的右子树可跳过。边界 inclusive 写成 exclusive。O(n) worstO(h)
15Leaf-Similar Trees
NEW - 30m solve + 5m evidence
叶序列 DFS只收集左右都空的节点值。把单 child 节点当叶子。O(n+m)O(n+m)

今日验收

OutputStrava blind prompt, transfer artifact, script/audio, and follow-up response.
Hard failPassive reading without a spoken answer; missing invariant/failure/recovery/metric; any day outside Week 7 touched.
RepairPick the weakest answer and redo it for 8 minutes with one new failure window.
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.