Sign in to track progress, unlock prep layers, and browse your pipeline.Sign in
Design a Story feature with offline support
Design a "Story" feature, similar to those found in social applications, with the following capabilities:
Core User Features
- Users can create a story, which can be a photo or video with an optional caption.
- Followers or friends of a user can view that user's story.
- Stories expire after a fixed Time-To-Live (TTL), typically 24 hours.
Additional Requirements
- Favorite/Bookmark: Users can mark a story as a "favorite" for easy retrieval.
- Save for Offline: Users can explicitly save stories for offline viewing. This involves both device-side downloads and server-side state management.
- Offline Mode: When a device has no network connectivity, the application should still be able to display previously saved stories.
Non-Functional Requirements
- Scale: The system must handle very large scale, supporting tens to hundreds of millions of users with heavy read traffic.
- Latency: Story viewing should have low latency.
- Privacy: Implement robust privacy controls, including friends-only access, custom lists, and blocking mechanisms.
- Data Consistency: Correctly handle deletes and expirations across caches and offline copies.
Deliverables:
- APIs for core actions (create story, fetch feed, view story, favorite/unfavorite, save/unsave).
- High-level architecture, including storage, caching/CDN, and fan-out strategies.
- Data model design.
- Offline synchronization strategy, addressing edge cases like expiration, revocation, and device storage pressure.
- Considerations for metrics and overall system reliability.
AI interview prep
Core dilemma
Balancing the real-time delivery of ephemeral content to a massive, globally distributed user base with the complexities of offline access, data consistency, and privacy.
Mid-level signals3
Senior signals3
Red flags3
3 tradeoffs and 3 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Design a Story feature with offline support
Design a "Story" feature, similar to those found in social applications, with the following capabilities:
Core User Features
- Users can create a story, which can be a photo or video with an optional caption.
- Followers or friends of a user can view that user's story.
- Stories expire after a fixed Time-To-Live (TTL), typically 24 hours.
Additional Requirements
- Favorite/Bookmark: Users can mark a story as a "favorite" for easy retrieval.
- Save for Offline: Users can explicitly save stories for offline viewing. This involves both device-side downloads and server-side state management.
- Offline Mode: When a device has no network connectivity, the application should still be able to display previously saved stories.
Non-Functional Requirements
- Scale: The system must handle very large scale, supporting tens to hundreds of millions of users with heavy read traffic.
- Latency: Story viewing should have low latency.
- Privacy: Implement robust privacy controls, including friends-only access, custom lists, and blocking mechanisms.
- Data Consistency: Correctly handle deletes and expirations across caches and offline copies.
Deliverables:
- APIs for core actions (create story, fetch feed, view story, favorite/unfavorite, save/unsave).
- High-level architecture, including storage, caching/CDN, and fan-out strategies.
- Data model design.
- Offline synchronization strategy, addressing edge cases like expiration, revocation, and device storage pressure.
- Considerations for metrics and overall system reliability.