KatInterview

Offline Audio Moderation Pipeline: End-to-End Architecture

System DesignModel answer
HardModel answerSystem Designml-system-designaudiopipeline-orchestration

Last updated

Design a batch pipeline that screens stored audio files for policy violations, labels each as safe, unsafe or uncertain, and routes uncertain ones to human reviewers.

Problem

A platform lets users upload audio files (voice clips, music, sound effects). You must design a system that inspects each stored file, not a live stream, and decides whether it is acceptable to publish.

Choosing or training the individual ML models is out of scope. Show instead how the building blocks fit together: speech-to-text, spectral/loudness analysis, keyword detection, noise reduction, and a rule-based post-processor that combines their outputs.

What to cover

  1. Requirements. Functional and non-functional, with explicit scale assumptions (uploads per day, file length, latency target).
  2. Entities and data model. Key records, what lives in a database versus an object store, and how you guarantee idempotency.
  3. Architecture. Storage, compute, and orchestration.
  4. Discovery. How newly saved files are found and started: scheduled batch versus event-driven, and what you do about missed events.
  5. Processing flow. From ingestion through to a final result, including where each component sits.
  6. Outcome classification. How a file ends up as clean, problematic, or needs human review.
  7. Manual review workflow. Task assignment, labeling, multi-reviewer agreement, requeueing, and audit trail.
  8. Operations. Scalability, throughput and latency targets, data retention, fault tolerance, backfilling after policy or model changes, and cost controls.
  9. Measurement. Success metrics plus monitoring and alerting for both product quality and system health.

State your assumptions and explain the trade-offs behind your choices.

Hints

Hint 1

Start with numbers: estimate files per day, average and peak rate, total audio-hours, and the GPU capacity needed for transcription. These drive the batch-vs-event and autoscaling choices.

Hint 2

Treat the three-way outcome as two thresholds per category: a high one for confident blocking and a low one for confident approval. Everything between, plus low-confidence or unprocessable inputs, goes to humans. Never default a failed decode to clean.

Hint 3

Make every stage idempotent (unique key on asset plus pipeline version), keep large artifacts in object storage with pointers in the database, and pair event-driven triggers with a periodic reconciliation sweep so nothing is silently skipped.

Hint 4

For the review loop, think leases with expiry, per-language queues, required votes with escalation on disagreement, and feeding final labels back to tune thresholds and retrain.