HLD-309·Caching & Consistency
Hard · 1,500 ptsInline Card Payment Fraud & Velocity Feature Store
Design an ultra-low-latency feature store serving synchronous card-swipe velocity aggregates to fraud ML models on the live payment authorization path.
Max p99
≤ 35 ms
Availability
≥ 99.5%
Budget
≤ $6,400
Functional Requirements
- FR-1GET /features/{card_hash} — Fetches 1m/5m/1h spend & merchant velocity features under 35ms p99.
- FR-2POST /features/{card_hash}/events — Records swipe attempt immediately so rapid card-testing attacks are caught.
- FR-3PATCH & DELETE /features/{card_hash} — Updates, cancels, or deletes card_hash records and immediately invalidates or updates cached state (read-after-write).
- FR-4Velocity counters must reflect the prior swipe immediately (read-after-write) and survive node crashes.
Workload Profile
Baseline Swipes56,000 Feature Read RPS / 11,000 Event Write RPS
Black Friday Peak145,000 Read RPS / 30,000 Write RPS
Active Working Set32 GB rolling velocity counters
Latency GateInline card-network timeout budget p99 <= 35 ms
Consistency Model
Read-after-write consistency required so sequential card-testing swipes immediately see updated velocity counts.
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