← All problems
Dashboard
Courses
Problems
Badges
Theme
Sign inStart free
Problem 050 · Messaging and event-driven systems

Design a Content Moderation Pipeline

Medium 50 min

A social app receives 8 million posts a day, a third of them with images, peaking at about 1,500 uploads per second during evening hours. Before a post becomes public it must be checked for spam, nudity, violence and hate speech. Classifiers take 50 to 300 ms per item and give a confidence score: clear-cut posts are published or blocked automatically, and uncertain ones go to a team of 400 human moderators who need prioritised queues. Users who post must get a fast response, the policy team changes rules weekly, and every decision must be auditable for appeals and regulators.

Functional requirements

  • Accept a new post and return quickly with a 'pending' or 'published' status
  • Run text and image classifiers and combine their scores with policy rules
  • Publish, block or escalate each post based on confidence thresholds
  • Give human moderators prioritised review queues and record their decisions
  • Handle user appeals and keep a full audit trail

Non-functional requirements

  • Upload requests return in under 300 ms at p95; most posts are decided within 10 seconds
  • No post becomes public without passing the pipeline
  • A classifier outage delays posts rather than losing them or publishing them unchecked
  • Moderators see the most harmful-looking items first

Constraints and scale

  • 8 million posts per day, peaking at 1,500 per second
  • Classifier latency of 50 to 300 ms per item on GPU-backed inference
  • 400 human moderators reviewing about 2% of posts

You will practise

  • Build an asynchronous pipeline of independent classifier stages with a queue
  • Route items by confidence between automatic action and human review
  • Handle poison messages and retries with a dead-letter queue
Show 3 hints
  1. Should the upload request wait for the image classifier to finish?
  2. An image crashes the classifier every time it is processed. What stops it from blocking the queue forever?
  3. How will a policy change (a new threshold) take effect without redeploying the pipeline?

Ready to build?

Open the canvas, place your components and explain your decisions. Your draft saves automatically.

Sign in to start

Failure scenarios

  • A coordinated spam waveA bot network posts 200,000 near-identical scam images in ten minutes. Classifier queues back up, genuine posts wait minutes to appear, and the human review queue fills with copies of the same image.

Run them from the workspace once your design is in place.