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
≤ $3,000
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.
Relevant practice for
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.
Click an item in Inventory above, or press B to add a component, double-click to name, C to connect.
Design Write-up
Write under ### Architecture for Diagram to take that up directly
Compulsory section · if not written yet, Diagram reads from the start of your write-up.
Architecture: required·FRs mentioned: 0/4·0 boxes · 0 edges
0 words