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.

Google
ML System Design
Machine Learning Engineer
Google
November 29, 2026
Machine Learning Engineer
Technical Screen
ML System Design
Easy

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
Spam classification
Low-latency inference
Text normalization
Burst detection
Moderator feedback
How to Approach This
  1. Start by mapping the business objective to a concrete ML objective and metric.
  2. Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
  3. Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
  4. Address the serving latency budget and whether batch or real-time inference is needed.
  5. 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 Problems
Sample 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
  1. Normalization: lowercase, map homoglyphs, remove spacing tricks ('w w w . scam'), extract URLs and channel mentions.
  2. Fast rules: creator blocked words, known scam domains, exact repeats....

Submit Your Answer
Markdown supported