Practice
1. A distributed key-value store must evenly distribute keys across nodes and handle node failures without massive data reshuffling. Which component primarily enables this?
easy
Solution
Step 1: Identify the role of consistent hashing
Consistent hashing distributes keys to nodes such that when nodes join or leave, only a small subset of keys need reassignment, minimizing reshuffling.Step 2: Eliminate other components
Vector clocks handle version conflicts but do not distribute keys. Gossip protocol manages cluster membership but not key distribution. Quorum replication ensures durability but does not affect key assignment.Final Answer:
Option C -> Option CQuick Check:
Consistent hashing minimizes key remapping on node changes [check]
Hint: Consistent hashing minimizes key remapping on node changes [OK]
Common Mistakes:
2. 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:
3. In the failover incident trace, at Step 4 the Database Proxy receives a client query after the primary node crashed. What state does the proxy enter before forwarding the query?
easy
Solution
Step 1: Trace Database Proxy behavior at Step 4
Upon detecting primary failure, the proxy marks it unavailable and waits for leader election to complete before routing queries to the new leader.Step 2: Eliminate other options
Forwarding immediately to old primary (A) causes timeouts; queuing indefinitely (C) stalls clients; returning errors without retry (B) reduces availability.Final Answer:
Option A -> Option AQuick Check:
Proxy reroutes queries only after leader election [check]
Hint: Proxy reroutes only after leader election completes
Common Mistakes:
4. For candidate-job matching, which architecture better supports real-time personalized recommendations with low latency and frequent profile updates?
medium
Solution
Step 1: Analyze real-time personalization needs
Low latency and frequent profile updates require online, streaming data processing.Step 2: Evaluate architectures
Batch (A) is too stale; static precomputed scores (C) can't adapt quickly; client-side filtering (D) lacks server-side intelligence. Online feature store with streaming (B) supports fresh data and low latency scoring.Final Answer:
Option C -> Option CQuick Check:
Streaming updates + real-time scoring -> fresh personalized matches [check]
Hint: Streaming + online features enable fresh real-time recommendations [check]
Common Mistakes:
5. For delivering real-time location updates to mobile clients, which approach is better considering intermittent mobile network connectivity and battery constraints?
medium
Solution
Step 1: Evaluate persistent connection options
gRPC streaming is efficient but less supported on mobile platforms and can drain battery.Step 2: Compare WebSocket and polling
WebSocket supports bidirectional communication with reconnection and heartbeats, balancing real-time and battery use better than polling.Final Answer:
Option A -> Option AQuick Check:
WebSocket balances real-time updates and mobile constraints [check]
Hint: WebSocket with reconnection beats gRPC streaming on mobile [check]
Common Mistakes:
