Practice/Meta/Design Instagram Stories
Design Instagram Stories
Product DesignOptional
Problem Statement
You need to design a real-time sports commentary platform similar to ESPN's live blogs or The Athletic's game threads, where sports journalists and fans can post rapid-fire updates, reactions, and analysis during live sporting events. The platform must handle millions of concurrent viewers during major games, with commentary updates appearing within seconds. Users should be able to follow specific games, receive push notifications for major moments, react to comments, and filter content by different types (official updates, fan reactions, expert analysis). The system needs to support approximately 50,000 games per day across different sports globally, with peak traffic during major events like World Cup finals potentially reaching 20 million concurrent users on a single game thread.
Key Requirements
Functional
- Real-time commentary posting -- journalists and verified users can publish text, images, and short video clips with sub-second latency
- Live feed consumption -- viewers receive updates in near real-time without manual refreshing, with threaded conversations
- Engagement features -- users can react, reply, bookmark key moments, and share individual comments
- Content moderation -- automated and manual systems to filter inappropriate content and manage spam during high-traffic events
- Multi-game following -- users can track multiple live games simultaneously and switch between feeds seamlessly
Non-Functional
- Scalability -- support 20 million concurrent users on popular games, with 50,000+ simultaneous active game threads
- Reliability -- 99.99% uptime during scheduled sporting events, with graceful degradation under extreme load
- Latency -- commentary appears to viewers within 2 seconds of posting, with optimistic UI updates under 500ms
- Consistency -- eventual consistency acceptable for reactions and metrics, strong consistency for comment ordering within threads
What Interviewers Focus On
Based on real interview experiences, these are the areas interviewers probe most deeply:
1. Real-Time Message Distribution Architecture
Interviewers want to see how you handle fan-out of updates to millions of concurrent viewers without overwhelming your infrastructure. This tests your understanding of pub-sub patterns, WebSocket management, and client-side optimization.
Hints to consider:
- Consider hybrid push-pull models where WebSockets deliver critical updates while polling handles secondary data
- Discuss how you'd shard users across WebSocket servers and handle connection recovery
- Think about geographic distribution and using CDNs for static content while keeping dynamic feeds local
- Explore client-side batching and deduplication to reduce server load during peak moments
2. Write Amplification and Fan-Out Strategies
A single comment from a journalist might need to reach 10 million viewers instantly. Interviewers probe how you'd architect the write path to avoid overwhelming downstream services.
Hints to consider:
- Differentiate between hot games (millions watching) and cold games (hundreds watching) with different fan-out strategies
- Consider message queues with prioritization for distributing updates across consumer groups
- Discuss pre-computing aggregations for reactions and metrics versus real-time computation
- Think about rate limiting and queueing writes during viral moments when everyone posts simultaneously
3. Storage Strategy for Time-Series Commentary Data
Commentary is inherently time-ordered and has a natural lifecycle (relevant during game, archived after). Interviewers want to understand your data modeling and storage tier decisions.
Hints to consider:
- Explore time-series databases or partitioning strategies in traditional databases for efficient range queries
- Consider hot-warm-cold storage tiers where recent games stay in memory/SSD and old games move to cheaper storage
- Think about denormalization for read-heavy workloads versus normalized schemas for write consistency
- Discuss caching strategies for the most recent N comments and how cache invalidation works
4. Handling Thundering Herd Problems
When a major goal or touchdown happens, millions of users might reload or reconnect simultaneously. This tests your understanding of load shedding and graceful degradation.
Hints to consider:
- Implement exponential backoff with jitter for client reconnection attempts
- Use admission control and load shedding at API gateways to protect downstream services
- Consider read replicas and cache stampede prevention for popular game threads
- Think about circuit breakers and bulkheads to isolate failures in one game thread from affecting others