Skip to main content

Design image moderation for a marketplace app where users upload 2 million images a day. Harmful images must be blocked before other users can see them.

System design · Pro 1

Short answer

Clarify the policy categories, whether checks run before or after publishing, and the cost of each error. Then: hash matching against known illegal images, a multi-label image classifier, per-category thresholds with three outcomes (allow, block, human review), an appeals path, reviewer decisions fed back as labels, and metrics for recall, precision and review time.

Deeper answer

Start with the policy. List the categories, such as nudity, violence and banned goods, and how severe each is. Blocking before display means the check sits in the upload path, so it needs a latency target of a few seconds.

Pipeline: first compare a perceptual hash of the image with a list of known harmful images. Then run a multi-label classifier, usually a pretrained vision model fine-tuned on the platform's own data. Each category has two thresholds. Below the low one the image is allowed, above the high one it is blocked, and between them it goes to human review. Severe categories get lower thresholds, which means higher recall and more review work.

Labels come from reviewers, user reports and appeals. Sample allowed images at random for audit, or missed harm stays invisible. Evaluate per category with precision and recall on a held-out set, and track real prevalence online.

Trade-offs: recall against reviewer load and seller frustration, and model size against GPU cost at 2 million images a day. At scale, new evasion methods such as cropped or overlaid images, policy changes, and reviewer consistency and wellbeing break first.

What a strong answer covers

Answer it out loud in the mock interview about 2.5 min

Follow-ups to expect

Common mistakes

Learn it

CNNs for images

Practice System design questions

More on this topic

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.