Week 10 · Day 5 · 2026-10-02 FRI · FULL · attempt + follow-up
Local Delivery full: availability, nearby DCs, inventory reservation
今日目标
Complete Local Delivery as the inventory analogue to Uber driver reservation: fast availability, strong checkout truth.
| 08:50-09:00 | Set target One sentence: availability can be cached, physical inventory reservation cannot oversell. |
|---|---|
| 09:00-10:05 | Attempt + Hello Interview reading Read Local Delivery complete page through deep dives and levels. |
| 10:05-10:45 | Decision note Nearby DC search, drive-time filtering, cache/read replica path, ACID order reservation. |
| 10:45-10:55 | Spoken close Explain union availability vs checkout truth. |
| 14:30-16:15 | NeetCode Tag · Intervals Exactly three contiguous slots; each slot is 30m solve + 5m evidence. |
| 20:30-21:15 | Recall / Mock 20:30-21:15 Local Delivery Chinese explainer/audio and English recall outline. |
Live canonical source anchors
Daily anchors retain the original Hello Interview heading text.
| Project | Exact canonical source heading | Disposition | Use |
|---|---|---|---|
| Local Delivery Service | Understanding the Problem | required reading | micro-DC inventory and rapid delivery |
| Local Delivery Service | Functional Requirements | required reading | availability by location and multi-item order |
| Local Delivery Service | Non-Functional Requirements | required reading | <100ms reads, strong ordering, 10k DCs, 100k items, 10M orders/day |
| Local Delivery Service | Set Up | required reading | strictly availability and ordering |
| Local Delivery Service | Planning the Approach | required reading | entities/API/HLD before deep dives |
| Local Delivery Service | Defining the Core Entities | required reading | Inventory, Item, DistributionCenter, Order |
| Local Delivery Service | Defining the API | required reading | availability and order APIs |
| Local Delivery Service | High-Level Design | required reading | Availability Service, Nearby Service, Inventory table, Orders Service |
| Local Delivery Service | 1) Customers should be able to query availability of items | required reading | nearby DC union availability |
| Local Delivery Service | 2) Customers should be able to order items. | required reading | atomic inventory/order transaction |
| Local Delivery Service | Putting it all Together | required reading | initial full design |
| Local Delivery Service | Deep Dives | deep dive | traffic/drive-time and scaling reads |
| Local Delivery Service | 1) Make availability lookups incorporate traffic and drive time | deep dive | nearby candidate DCs then travel-time filter |
| Local Delivery Service | 2) Make availability lookups fast and scalable | deep dive | cache, read replicas, partitioning |
| Local Delivery Service | What is Expected at Each Level? | level expectation | calibrate full-coverage bar |
| Local Delivery Service | Mid-Level | level expectation | functional availability/order paths |
| Local Delivery Service | Senior | level expectation | optimized availability and order consistency |
| Local Delivery Service | Staff+ | level expectation | 2-3 deep insights with recovery and trade-offs |
DDIA decision links
| Week 10 decision | Exact DDIA subsection | Design consequence |
|---|---|---|
| Why is inventory order placement not allowed to be eventually correct? | Ch10 - 线性一致性 | Checkout sees one serial order of inventory reservation; two orders cannot both own one physical unit. |
| What do queueing delays do to driver accept and order cancellation? | Ch9 - 超时和无界延迟 | Timeouts are business states, not proof the client/server failed; late responses must be version-checked. |
Algorithm block
| Slot | Problem | Pattern | Invariant | Bug risk | Time | Space |
|---|---|---|---|---|---|---|
| 13 | Minimum Number of Arrows to Burst Balloons NEW · 30m solve + 5m evidence | greedy by end | One arrow at current end bursts all overlapping balloons. | Inclusive endpoint overlap. | O(n log n) | O(1) |
| 14 | The Number of the Smallest Unoccupied Chair NEW · 30m solve + 5m evidence | event heaps | Free chairs before seating arrivals at same time. | Arrival/leave tie ordering. | O(n log n) | O(n) |
| 15 | Check if Grid can be Cut into Sections NEW · 30m solve + 5m evidence | project rectangles to intervals | Two valid cuts require at least three merged non-overlap groups on one axis. | Merging touching projections incorrectly. | O(n log n) | O(n) |
Output and repair
| Deliverable | Local Delivery 35m attempt/follow-up: DC service area, availability cache, inventory/order transaction, substitution/cancel state. |
|---|---|
| Repair rule | If reads and checkout share the same stale count, split availability projection from transactional reservation. |
| Artifacts | Local Delivery Chinese explainer Local Delivery Chinese audio Local Delivery English recall |
| English recall | English recall: defend freshness, reservation, race recovery, fairness, and observability without reading notes. |
Detailed lecture notes, audio, recall scripts, PDFs, Staff Q&A, and mock packs are archived locally and are intentionally not published on this site.