Practice
1. In a consistent hashing system, at Step 4 the request router receives a key and queries the hash ring to find the responsible shard. What happens if the shard mapped by the hash ring is currently down?
easy
Solution
Step 1: Trace request router behavior on shard failure
Retrying the same shard (The router retries the same shard until it recovers before forwarding the request) blocks requests; returning error (The router returns an error immediately to the client indicating shard unavailability) reduces availability; next clockwise shard (The router uses the next clockwise shard on the hash ring as a fallback for the key) is correct only if the ring is intact and shard failure is handled by virtual nodes.Step 2: Understand fallback hashing
Rehashing with a different function (The router hashes the key again with a different hash function to find another shard) is a common fallback to find an alternate shard when the primary is down, ensuring availability without blocking or errors.Final Answer:
Option D -> Option DQuick Check:
Fallback hashing finds alternate shard on failure [check]
Hint: Fallback hashing finds alternate shard if primary is down [OK]
Common Mistakes:
2. A video streaming service needs to deliver personalized movie recommendations to millions of users with low latency. Which component is best suited to handle the real-time personalization computation at scale?
easy
Solution
Step 1: Identify personalization latency requirements
Real-time personalization requires low latency responses, which batch processing (A batch processing system that recomputes recommendations once per day) cannot provide.Step 2: Evaluate component suitability
Relational DB (A relational database with complex SQL queries for each user request) is too slow for per-request complex queries at scale. CDN edge servers (A CDN edge server that directly computes recommendations on user devices) lack the data and compute power for personalization. Distributed in-memory cache (A distributed in-memory cache with precomputed user profiles updated asynchronously) supports fast lookups with asynchronously updated profiles, fitting the latency and scale needs.Final Answer:
Option A -> Option AQuick Check:
In-memory cache with async updates enables low-latency personalization [check]
Hint: Precompute profiles in cache for fast personalization [check]
Common Mistakes:
3. If the cache warming service crashes after partially warming keys but before marking completion, what is the immediate failure observed during launch?
medium
Solution
Step 1: Trace failure impact of partial warming crash
Without completion mark, warming restarts causing duplicate warming and resource waste.Step 2: Eliminate other options
Stale data unlikely if warming overwrites; cache misses occur but duplicate warming is immediate failure; fallback read-through causes latency, not immediate failure.Final Answer:
Option B -> Option BQuick Check:
Crash without completion causes duplicate warming retries [check]
Hint: Crash without completion mark causes duplicate warming retries [check]
Common Mistakes:
4. 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:
5. At 10x scale, which component is most likely to fail first and why in Slack's real-time delivery system?
hard
Solution
Step 1: Identify stateful bottlenecks at scale
Chat servers hold WebSocket connections in memory, which are stateful and tied to specific servers, limiting horizontal scaling.Step 2: Compare other components
Databases can be sharded; Kafka scales with partitions; presence service caches can be distributed; chat servers' stateful connections are the hardest to shard.Final Answer:
Option A -> Option AQuick Check:
Stateful WebSocket connections -> chat servers bottleneck at 10x scale [check]
Hint: Stateful WebSocket binds chat servers -> first bottleneck [check]
Common Mistakes:
