HLD-124·Caching & Edge
Easy · 500 ptsPerceptual Image Hash & Blocklist Moderation API
Design a trust-and-safety hash lookup API checking uploaded media PDQ/PhotoDNA hashes and banned URL signatures before content goes live.
Max p99
≤ 35 ms
Availability
≥ 99.5%
Budget
≤ $2,430
Functional Requirements
- FR-1POST /moderation/check — Checks perceptual hash_bucket against known policy blocklists.
- FR-2POST /moderation/signatures — Appends newly flagged perceptual hashes from safety reviewers.
- FR-3PATCH & DELETE /moderation/check/{hash_bucket} — Updates, revokes, or deletes hash_bucket entries with bounded TTL or explicit cache/index invalidation.
- FR-4Must keep upload checks under 35ms p99 even if primary signature DB crashes.
Workload Profile
Baseline Uploads21,000 Lookup RPS / 600 Signature Write RPS
Spam Bot Campaign58,000 Lookup RPS / 1,800 Write RPS
Active Working Set10 GB hot perceptual hash prefixes & bloom filters
Traffic DistributionRepeated viral reposts hit identical hash_bucket keys
Consistency Model
Eventual blocklist propagation (< 5s) to edge caches acceptable; new signatures durably stored.
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