Design an Instagram-Style Social Feed
Company: Meta
Role: Software Engineer
Category: System Design
Difficulty: medium
Interview Round: Onsite
##### Question
Design an Instagram-style photo and video sharing service with a personalized home feed (similar to Instagram).
**Functional requirements:**
1. Users can create accounts, view profile pages, and follow/unfollow other users.
2. Users can create posts containing media (photos and short videos) plus a caption. Media storage is handled separately from post metadata.
3. Users can view a personalized home feed of recent or ranked posts from accounts they follow (with optional recommendations), using infinite scroll.
4. Users can like, comment on, and delete posts, and view post-detail pages.
5. Media should be uploaded from mobile and web clients and served globally with low latency through a CDN.
6. Support basic privacy (e.g. private accounts) so non-followers cannot see protected content.
**Non-functional requirements:**
1. High read availability and low feed latency (feeds are far more read-heavy than write-heavy).
2. The system should be highly available and horizontally scalable, with freshness (new posts appear quickly).
3. Eventual consistency is acceptable where appropriate (feed ordering, counters); stronger consistency is needed for authorization, privacy, and deletes.
4. The design must survive sudden traffic spikes caused by celebrity accounts, viral posts, or very popular comments.
**Discuss:** APIs, data models, storage choices, media upload and processing, feed generation, caching/CDN, asynchronous processing, rate limiting, reliability/monitoring, and strategies for hot accounts and hot posts.
**Deep-dive follow-up (upload security):** The upload flow uses object-storage pre-signed URLs so clients can upload media directly to object storage. How can the system prevent or mitigate malicious uploads? Specifically, explain why size limits and server-side validation help, what they do *not* solve, and what additional controls are required.
*Out of scope (optional): full recommendation ML, stories, ads.*
Quick Answer: A Meta software-engineer onsite system-design question: design an Instagram-style social feed (photo/video sharing with a personalized home feed). It tests scalable, highly available feed design — hybrid fanout, data modeling, media storage and CDN delivery, caching, sharded counters, rate limiting, privacy/authorization, and a security deep-dive on pre-signed-URL uploads.