Design a backend system for an Instagram Stories–like feature.
Users can post short-lived stories (photos/videos) that are visible to followers and automatically expire after 24 hours.
Core requirements
-
Post story
: user uploads media and publishes a story.
-
View stories
: followers can see a tray/list of accounts with active stories and play story segments.
-
Expiration
: stories disappear after 24 hours (should not be viewable).
-
Privacy
: stories can be shared with either (a) all followers or (b) a restricted audience (e.g., “Close Friends”).
-
Seen state
: track whether a viewer has seen a given story segment (for UI ordering and analytics).
Non-functional requirements
-
Very low latency for story playback (global audience).
-
High availability.
-
Large scale (tens/hundreds of millions of users).
Deliverables
-
Propose APIs, data model, storage choices, and major services.
-
Explain how you handle upload/transcoding/CDN delivery.
-
Explain feed/tray generation (fanout strategies), caching, and expiration.
-
Discuss consistency trade-offs for “seen” state and counters.
-
Outline monitoring/metrics and failure modes.