Practice/Meta/Design an Image Uploader
Design an Image Uploader
Product DesignMust
Problem Statement
Design a video streaming service similar to YouTube or Netflix that can serve millions of concurrent viewers worldwide. The system must handle video uploads from content creators, process videos into multiple quality formats (360p, 720p, 1080p, 4K), and deliver smooth playback experiences to users on various devices and network conditions. The platform should support 10,000 video uploads per day and stream content to 5 million concurrent users with minimal buffering. Consider how to handle peak traffic during popular live events, optimize storage costs for petabytes of video content, and ensure low-latency playback globally.
Key Requirements
Functional
- Video Upload & Processing -- content creators can upload videos up to 10GB in size; system transcodes to multiple resolutions and formats
- Adaptive Streaming -- deliver appropriate video quality based on user's bandwidth and device capabilities
- Video Playback -- support play, pause, seek, and resume functionality with minimal startup delay
- Content Metadata -- store and retrieve video titles, descriptions, thumbnails, view counts, and creator information
- Recommendations -- surface relevant content to users based on viewing history and preferences
Non-Functional
- Scalability -- handle 5 million concurrent viewers and 10,000 uploads daily; scale during viral events
- Reliability -- 99.9% uptime for streaming; gracefully handle failures in processing pipeline
- Latency -- video startup time under 2 seconds; seek operations under 1 second globally
- Consistency -- eventual consistency acceptable for view counts; strong consistency for user subscriptions and access control
What Interviewers Focus On
Based on real interview experiences, these are the areas interviewers probe most deeply:
1. Video Processing Pipeline Architecture
How you design the upload and transcoding workflow directly impacts cost and user experience. Interviewers want to see if you understand asynchronous processing, job queues, and how to handle long-running tasks reliably.
Hints to consider:
- Consider using a message queue to decouple upload from processing so users don't wait for transcoding
- Think about parallel processing of different resolutions and how to track job status
- Discuss retry mechanisms for failed transcoding jobs and dead letter queues
- Consider how to prioritize processing for popular creators or time-sensitive content
2. Content Delivery and Caching Strategy
Serving video efficiently at global scale requires sophisticated caching. Expect deep questions about CDN architecture, cache invalidation, and handling the long-tail problem where unpopular content still needs to be available.
Hints to consider:
- Leverage CDNs to cache popular content close to users; discuss cache eviction policies
- Consider origin servers vs edge locations and how to route requests
- Think about the 80/20 rule where 20% of content gets 80% of views -- optimize accordingly
- Discuss how to handle cache misses and fallback mechanisms
3. Adaptive Bitrate Streaming Protocol
Modern video delivery requires switching quality mid-stream. Interviewers probe whether you understand protocols like HLS or DASH and how clients negotiate bitrate.
Hints to consider:
- Break videos into small chunks (2-10 seconds) that can be independently fetched at different qualities
- Generate a manifest file listing all available quality levels and chunk URLs
- Let the client measure bandwidth and choose appropriate quality; server provides options
- Consider how to handle quality switches smoothly without playback interruption
4. Storage Optimization and Cost Management
Storing multiple formats of petabytes of video is extremely expensive. Senior candidates should think about tiered storage, deduplication, and lifecycle policies.
Hints to consider:
- Use object storage like S3 for durability but consider cold storage tiers for old unpopular content
- Implement deduplication to detect re-uploaded identical videos using content hashing
- Discuss compression techniques and codec choices that balance quality vs file size
- Consider automatically archiving videos that haven't been watched in months to cheaper storage
5. Database Schema and Metadata Management
Efficiently querying video metadata, user interactions, and recommendations requires thoughtful data modeling. Expect questions about read vs write patterns and how to scale database access.
Hints to consider:
- Separate hot data (currently trending videos) from cold data (old archive content)
- Consider NoSQL for video metadata given flexible schema and high read throughput needs
- Use caching layers like Redis for frequently accessed data like view counts
- Think about denormalization to avoid expensive joins when serving video pages