Practice
1. If the Kafka cluster buffering RTMP packets crashes and loses the latest messages, what exactly breaks in the live streaming pipeline?
medium
Solution
Step 1: Understand Kafka's role
Kafka buffers RTMP packets to ensure ordered, durable delivery to the transcoder.Step 2: Trace failure impact
If Kafka loses messages, the transcoder stalls (A) due to missing packets, causing segment gaps. CDN (B) serves only what it has, so stale segments appear. RTMP ingest server (C) does not retry lost packets automatically; loss is permanent. Player (D) cannot switch streams without explicit failover.Final Answer:
Option B -> Option BQuick Check:
Kafka loss causes permanent packet loss; RTMP ingest lacks automatic retry [check]
Hint: Kafka loss means lost packets; RTMP ingest has no auto-retry [check]
Common Mistakes:
2. For a recommendation engine requiring fast traversal of user-item relationships with frequent updates, which architecture is best suited?
medium
Solution
Step 1: Analyze requirement
Fast traversal with frequent updates demands low-latency graph traversals and quick writes.Step 2: Evaluate architectures
Relational DBs have high JOIN cost; batch pipelines add latency; key-value stores lack flexible traversal.Step 3: Choose architecture
In-memory graph DBs with eventual consistency balance fast traversals and update throughput.Final Answer:
Option D -> Option DQuick Check:
In-memory graph DBs optimize traversal speed and handle frequent updates well [check]
Hint: In-memory graph DBs balance speed and updates best [check]
Common Mistakes:
3. Without the message broker (e.g., Kafka) in a high-throughput chat system, what exactly breaks in the message delivery flow?
medium
Solution
Step 1: Role of message broker
Broker decouples sender and receiver, enabling asynchronous delivery and retries.Step 2: Consequence of missing broker
Without it, messages are sent synchronously causing sender blocking; if receiver crashes, messages are lost; encryption (A) unaffected; blocking and loss (C) is exact failure; batch mode (D) not automatic.Final Answer:
Option A -> Option AQuick Check:
Broker removal causes blocking sends and message loss on receiver failure [check]
Hint: No broker means synchronous sends block and lose messages [check]
Common Mistakes:
4. At 10x scale, which component in a push-based newsfeed system is most likely to fail first and why?
hard
Solution
Step 1: Analyze database scaling
Databases can be sharded and scaled horizontally; not usually the first bottleneck.Step 2: Analyze fan-out service scaling
Push-based fan-out causes write amplification proportional to follower count; at 10x scale, this bottleneck grows superlinearly and saturates first.Step 3: Analyze cache and web servers
Caches can be scaled with eviction and sharding; web servers scale with load balancers and stateless design.Final Answer:
Option A -> Option AQuick Check:
Fan-out write amplification causes first bottleneck at 10x scale [check]
Hint: Fan-out write amplification hits first at 10x scale [check]
Common Mistakes:
5. At 10x scale, which component is most likely to become the bottleneck first in the typeahead system, and why?
hard
Solution
Step 1: Analyze component scalability
Personalization stores can be sharded; ranking computations scale linearly; front-end servers can be horizontally scaled.Step 2: Identify Trie cache bottleneck
Trie caches hold large in-memory prefix trees; sharding by prefix has limits due to prefix overlap and memory footprint, causing latency and memory bottlenecks.Final Answer:
Option D -> Option DQuick Check:
Trie cache memory and shard limits -> first bottleneck at 10x scale [check]
Hint: Trie cache memory limits cause first bottleneck at scale [check]
Common Mistakes:
