Design Upload-Time Safety Scanning for User Media Across Google Products
Last updated: November 29, 2026
Quick Overview
Design a shared service that scans images and videos uploaded to Google products (Photos sharing, Drive public links, YouTube, Chat) for policy violations, using hash matching and classifiers, before or shortly after the content becomes visible.
0
0
0 solved
Design a shared service that scans images and videos uploaded to Google products (Photos sharing, Drive public links, YouTube, Chat) for policy violations, using hash matching and classifiers, before or shortly after the content becomes visible.
Every Google surface that accepts uploads needs abuse protection, and a shared platform avoids each team rebuilding it. Interviewers use this to probe latency budgets for blocking scans, hash-matching at scale, classifier cost on video, and the policy and appeal workflow around automated decisions.
What the Interviewer Expects
- Offer synchronous and asynchronous scan modes with different latency budgets
- Match against known-bad hash databases with perceptual hashing
- Run classifiers efficiently, sampling video frames
- Route results to product-specific policy actions and human review
- Keep audit trails and appeals while protecting reviewer wellbeing
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- Which surfaces must block before the upload is visible, and which can scan after?
- How do you detect slightly edited copies of known bad content?
- How do you keep reviewers from being exposed to harmful content unnecessarily?
- How do you roll out a new classifier without a flood of false takedowns?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: products call scan(media, context); the service returns verdicts per policy (for example violent extremism, sexual content, malware for files, spam) with confidence; products apply t...
High-Level Design
- Scan API with sync and async modes.
- Hash matcher: computes exact (SHA-256) and perceptual hashes and looks them up in industry and internal hash databases.
- Classifier fleet: image an...