KatInterview

Design a Distributed File Ingestion and Threat Analysis Platform

System DesignModel answer
MediumModel answerSystem Designdistributed-systemsasync-workflowssecurity

Last updated

Design an async, high-throughput system that ingests large files, fans out to multiple scan engines in isolation, and delivers a consolidated threat report.

Distributed File Ingestion and Threat Analysis Platform

Your task is to design a backend platform that lets authenticated users submit files for automated threat analysis. Uploaded files are passed concurrently through several independent scanning engines. The platform then consolidates the results into a single report and alerts the user when the process is complete.

Functional Requirements

  1. Authenticated users can upload files as large as 500 MB.
  2. Every uploaded file is scanned simultaneously by multiple analysis engines (internal or third-party).
  3. Users can check the current status of a submission and retrieve the final report at any time.
  4. Any file flagged as a threat by at least one engine must be isolated from general access immediately.

Non-Functional Requirements

  1. Uploaded files must be durable and the ingestion path highly available.
  2. The system must scale horizontally to absorb traffic spikes without dropping jobs.
  3. Scan engine health, latency, and queue depth must be observable in real time.
  4. The design must be security-first: scanning runs in an isolated environment, and untrusted files never reach end-users before a clean verdict.

What Your Answer Should Cover

  • API Design — the key endpoints for submitting a file, polling status, and retrieving a report.
  • Data Model — the schema for file metadata, scan jobs, and per-engine results.
  • Architecture — a high-level diagram of the async workflow, including how events move from upload to verdict.
  • Error Handling — how the system deals with engine failures, partial results, timed-out jobs, and malformed uploads.

Spend the first few minutes asking clarifying questions and stating your scale assumptions out loud before jumping into the design.

Hints

Hint 1

Large files should never stream through your application servers. Think about how object storage presigned URLs let the client write bytes directly to the bucket, keeping your API tier stateless and cheap.

Hint 2

Each scan engine should have its own queue or topic. This prevents a slow or failing vendor from blocking progress on the other engines, and lets you scale and rate-limit each one independently.

Hint 3

Think through what 'partial results' means when a deadline is hit or an engine errors out. You need an explicit policy — and an explicit state in your schema — for every terminal condition, not just the happy path.