工作流调度
Question: YouTube transcode DAG 怎么重启不重做错误的阶段?
把 transcode/split/manifest 建模为有依赖的 job graph;每步输出到对象存储并带 content address/version。
完整覆盖 YouTube deep dives: adaptive bitrate processing, resumable uploads, large-scale upload/watch, plus speeding-up uploads and view-count tangent as bounded extras.
| 08:50-09:00 | Set target 写下今天的核心不变量:未完整验证的 rendition/manifest 不能被发布。 |
|---|---|
| 09:00-10:05 | Deep-dive reading 精读 YouTube processing DAG, resumable upload, scale/CDN, level expectations. |
| 10:05-10:45 | Mechanism sheet 画 multipart resume + transcode DAG + atomic publish + CDN cache key / invalidation. |
| 10:45-10:55 | Spoken close 脱稿解释 failed upload 与 worker failure 的恢复,不许说 simply retry。 |
| 14:30-16:15 | NeetCode Trees Exactly three contiguous Trees slots. Each slot is 30m solve + 5m pattern/invariant/bug/complexity evidence. |
| 20:30-21:15 | Recall / Q&A / repair 20:30-21:15 完成 YouTube Senior+/Staff English recall script drill;对照 PDF 只看标题,不看答案。 |
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 link | Disposition | Use |
|---|---|---|
| Potential Deep Dives | deep dive | move from HLD to processing/failure/scale |
| 1) How can we handle processing a video to support adaptive bitrate streaming? | deep dive | DAG, transcoding fanout, manifest generation, publish complete |
| 2) How do we support resumable uploads? | deep dive | chunk fingerprints, ETags, resume by metadata, idempotent chunk status |
| 3) How do we scale to a large number of videos uploaded / watched a day? | deep dive | stateless service, Cassandra/cache, processors, S3, CDN |
| Some additional deep dives you might consider | deep dive | speeding up uploads, resume playback, view counts |
| What is Expected at Each Level? | level expectation | calibrate interview depth |
| Mid-level | level expectation | functional upload and playback |
| Senior | level expectation | multipart upload and post-processing depth |
| Staff+ | level expectation | tradeoffs, failure windows, scalability and operations |
Only exact Ch11/Ch12/Ch13 sections that change today's design are assigned.
Question: YouTube transcode DAG 怎么重启不重做错误的阶段?
把 transcode/split/manifest 建模为有依赖的 job graph;每步输出到对象存储并带 content address/version。
Question: worker 或机器故障后,哪些输出可以保留,哪些必须废弃?
job attempt 带 idempotency key;只 publish manifest 指向已验证完整的一组 renditions。
Question: 重复 upload complete 或 duplicate view 如何处理?
uploadSessionId、partNumber、eventId、operationId 进入唯一约束或去重状态。
Question: 为什么 exactly-once 要说成端到端效果而不是 broker 魔法?
链路每端都要 operation id、dedupe、reconcile;单个中间件承诺不够。
Contiguous live NeetCode Trees order. No reviews. Three slots per day.
| # | Problem / mode | Pattern | Invariant | Bug risk | Time | Space |
|---|---|---|---|---|---|---|
| 4 | N-ary Tree Postorder Traversal NEW - 30m solve + 5m evidence | N 叉树 DFS | 所有 children 输出后才输出 parent。 | 迭代时 children 顺序要反向入栈。 | O(n) | O(h) |
| 5 | Invert Binary Tree NEW - 30m solve + 5m evidence | 后序/前序交换 | 每个节点的左右子树最终被交换一次。 | 先覆盖一个 child 丢失引用。 | O(n) | O(h) |
| 6 | Maximum Depth of Binary Tree NEW - 30m solve + 5m evidence | DFS 高度 | depth(node)=1+max(depth children)。 | 空节点返回 1 导致 off-by-one。 | O(n) | O(h) |
| Output | YouTube deep-dive sheet with invariant, triggering failure, recovery, metric, and English recall recording. |
|---|---|
| Hard fail | Passive reading without a spoken answer; missing invariant/failure/recovery/metric; any day outside Week 7 touched. |
| Repair | Pick the weakest answer and redo it for 8 minutes with one new failure window. |