HLD-232·Caching & Consistency
Medium · 1,000 ptsMulti-Warehouse Retail Inventory & Delivery Promise API
Design an Amazon-style product page availability ("In Stock — Arrives Tomorrow") service aggregating SKU stock across regional fulfillment centers.
Max p99
≤ 50 ms
Availability
≥ 99.5%
Budget
≤ $5,650
Functional Requirements
- FR-1GET /inventory/{sku_id}?zip={zip_prefix} — Returns regional in-stock badge and fastest warehouse promise.
- FR-2POST /inventory/{sku_id}/adjust — Applies WMS warehouse receipt/pick deltas and refreshes cache.
- FR-3PATCH & DELETE /inventory/{sku_id} — Updates, cancels, or deletes sku_id records and immediately invalidates or updates cached state (read-after-write).
- FR-4Must reflect out-of-stock transitions immediately (read-after-write) and survive DB node crashes.
Workload Profile
Steady Storefront Views38,000 Read RPS / 4,800 WMS Write RPS
Prime Deal Surge105,000 Read RPS / 13,000 Write RPS
Active Working Set24 GB hot catalog SKU warehouse counts
Traffic DistributionStrong Zipfian skew on featured homepage sku_id deals
Consistency Model
Read-after-write cache invalidation/write-through on stock depletion to prevent showing sold-out SKUs as available.
Solutions Locked
Sign in and either achieve AC or complete 3 official submissions on this question to inspect community diagrams and writeups.
Loading solutions...
Submission History (0)Select to replay
No submissions yet
Click Submit in the top bar to evaluate against all 7 judge cases and save each run here.
Design Write-up
0 boxes · 0 edges
0 words