Practice
1. A live streaming platform must ingest RTMP streams from millions of broadcasters with minimal latency and reliably convert them to HLS segments for viewers. Which component is best suited to buffer and order incoming RTMP packets before transcoding?
easy
Solution
Step 1: Identify buffering and ordering needs
RTMP packets must be buffered and ordered per stream before transcoding to maintain low latency and correct playback order.Step 2: Evaluate component suitability
A relational DB (A) is too slow for high-throughput packet buffering. Redis (C) lacks strong ordering guarantees and durability. CDN edge (D) caches output, not input packets. Kafka (B) supports partitioning by stream ID, ensuring ordered, durable buffering.Final Answer:
Option C -> Option CQuick Check:
Kafka partitions ensure ordered, durable buffering per stream [check]
Hint: Kafka partitions per stream ensure ordered, durable buffering [check]
Common Mistakes:
2. In a sliding window rate limiter, at step 3 the system records a new request timestamp. What happens internally to the stored counters at this step?
easy
Solution
Step 1: Understand sliding window counter mechanics
Sliding window counters maintain timestamps of recent requests and remove those outside the window to keep an accurate count.Step 2: At step 3, old timestamps beyond the window are purged before adding the new request timestamp
This ensures the count reflects only requests within the sliding window duration.Final Answer:
Option A -> Option AQuick Check:
Sliding window removes expired timestamps before counting new requests [check]
Hint: Sliding window purges old timestamps before counting new ones [check]
Common Mistakes:
3. At 10x scale, which component in WhatsApp's architecture is most likely to fail first and why?
hard
Solution
Step 1: Analyze stateful WebSocket connections on Chat Servers
Chat Servers maintain in-memory state per WebSocket; scaling requires connection migration which is complex.Step 2: Compare other components
Databases can shard; Kafka partitions can be increased with rebalancing; presence TTL cache scales horizontally.Final Answer:
Option A -> Option AQuick Check:
Stateful WebSocket connections -> Chat Servers bottleneck at scale [check]
Hint: Stateful WebSocket -> Chat Servers bottleneck at 10x scale [check]
Common Mistakes:
4. At 10x scale, which component fails first in a real-time chat system and why?
hard
Solution
Step 1: Identify stateful bottleneck at scale
Chat servers maintain stateful WebSocket connections bound to server memory, making resharding difficult at 10x scale.Step 2: Compare other components
Databases (A) can be scaled with sharding and caching; message queues (C) can add partitions; load balancers (D) scale horizontally more easily.Final Answer:
Option D -> Option DQuick Check:
Stateful WebSocket servers -> first bottleneck at 10x scale [check]
Hint: Stateful WebSocket servers block scaling; resharding is hard [check]
Common Mistakes:
5. At 10x scale, which component in a Cassandra cluster is most likely to fail first and why?
hard
Solution
Step 1: Identify bottlenecks at 10x scale
Coordinator nodes handle query routing and aggregation; increased scale causes them to manage larger partitions and more requests.Step 2: Compare other components
Storage nodes scale horizontally and add disk; network bandwidth scales with infrastructure upgrades; client latency is secondary to cluster bottlenecks.Final Answer:
Option A -> Option AQuick Check:
Coordinator overload -> first failure point at 10x scale [check]
Hint: Coordinator nodes bottleneck first at scale due to routing load [check]
Common Mistakes:
