Design a file upload and scanning report system
CrowdstrikeSoftware Engineer · OnsiteLast updated
This problem tests your ability to design a distributed, asynchronous system that handles high-throughput file uploads, coordinates multi-engine security scanning, and provides reporting capabilities.
Problem: Secure File Upload & Scanning System
Design a system that allows authenticated users to upload files for security scanning. Once a file is uploaded, it must be scanned by multiple third-party antivirus engines. The system should generate a comprehensive report of the findings and notify the user when the scan is complete.
Functional Requirements
- Users can upload files (up to 500MB each).
- The system triggers concurrent scans using multiple internal or third-party engines.
- Users can query the status and final report of their file uploads.
- Files must be quarantined if any scanner identifies a threat.
Non-Functional Requirements
- High availability and durability for uploaded files.
- Scalable processing to handle spikes in traffic.
- Observability to monitor scan engine health and latency.
- Security-first design (e.g., scanning should happen in an isolated environment).
Expected Components
- API Design: Outline the core endpoints for uploading, status checking, and report retrieval.
- Data Model: Describe the schema for tracking file metadata and scanning results.
- Architecture: Provide a high-level design, focusing on the asynchronous workflow using queues or message brokers.
- Error Handling: How do you handle scan engine failures, partial results, or corrupted files?
Hints
Hint 1
Consider using an object storage service with signed URLs for direct client uploads to keep large file traffic off your main application servers.
Hint 2
Use a message queue (like RabbitMQ or Kafka) to decouple the upload receipt from the intensive scan processing logic.
Hint 3
For the scanning layer, implement a worker pattern where individual containers perform the work in isolated sandboxes to prevent cross-contamination.
Follow-up questions
- How would you handle a scenario where one specific scan engine consistently times out or returns false positives?
- If the system experiences a massive influx of uploads (e.g., a burst of 10,000 files in one minute), how do you prevent the scan workers from being overwhelmed?
- How would you implement a 'webhook' notification system so that external services can be automatically alerted when a scan is finished?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.