Design Real-Time Spam Filtering for YouTube Live Chat Messages
Last updated: November 29, 2026
Quick Overview
During popular livestreams, YouTube live chat receives thousands of messages per minute including scam links, impersonation and repeated spam. Design a filter that decides within milliseconds whether to show, hold or hide each message.
0
0
0 solved
During popular livestreams, YouTube live chat receives thousands of messages per minute including scam links, impersonation and repeated spam. Design a filter that decides within milliseconds whether to show, hold or hide each message.
Live chat differs from comments because decisions are needed instantly and context changes fast. A screen-level question for trust and safety teams, checking a sensible feature set, latency awareness and creator controls.
What the Interviewer Expects
- Score each message in a few milliseconds
- Use message text, sender history and chat-level burst features
- Catch impersonation of the channel owner or moderators
- Support creator-defined blocked words and moderator actions as labels
- Choose actions with different thresholds
Key Topics to Cover
How to Approach This
- Start by mapping the business objective to a concrete ML objective and metric.
- Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
- Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
- Address the serving latency budget and whether batch or real-time inference is needed.
- Think about the data flywheel: how user feedback improves the model over time.
Possible Follow-up Questions
- How do you catch scam links written with spaces and symbols to avoid detection?
- What do you do when one spam message is posted by 300 new accounts?
- How do you avoid hiding legitimate messages in a non-English chat?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice ML System Design ProblemsSample Answer
Requirements
Inputs: message text, sender account, channel, timestamp. Output: show, hold for moderator review, or hide, within about 10 ms so chat feels live. Scale: tens of thousands of messages per minute on th...
High-Level Design
- Normalization: lowercase, map homoglyphs, remove spacing tricks ('w w w . scam'), extract URLs and channel mentions.
- Fast rules: creator blocked words, known scam domains, exact repeats....