Practice
1. In a Redis Cluster using consistent hashing, at Step 4 of a key lookup, the client sends a request to a node that responds with a MOVED error. What happens next?
easy
Solution
Step 1: Identify MOVED error semantics
MOVED indicates the key's hash slot is now served by a different node; client must update mapping.Step 2: Client reaction to MOVED
Client updates its slot-to-node cache and retries request on the correct node (The client updates its slot-to-node mapping and redirects the request to the correct node).Final Answer:
Option A -> Option AQuick Check:
Client updates mapping and retries -> correct node receives request [check]
Hint: MOVED error -> client updates mapping and retries correct node [OK]
Common Mistakes:
2. In the newsfeed system, at Step 4 the Delivery Worker reads a fan-out event from Kafka and attempts to deliver it to followers. What happens if a follower's device is offline at this step?
easy
Solution
Step 1: Trace Delivery Worker behavior at Step 4
The Delivery Worker reads fan-out events from Kafka and attempts delivery. If the follower is offline, immediate retry (A) would block and reduce throughput. Dropping messages (C) causes data loss. Pushing directly to device cache (D) is impossible if offline.Step 2: Understand retry mechanism
The system marks the message as sent but not delivered, queues it for retry later when the follower reconnects, ensuring eventual delivery without blocking.Final Answer:
Option A -> Option AQuick Check:
Offline followers cause queued retries, not immediate blocking [check]
Hint: Offline followers cause queued retries, not immediate blocking [check]
Common Mistakes:
3. A web application experiences frequent database read spikes causing high latency. Which component best reduces this latency by serving repeated reads efficiently?
easy
Solution
Step 1: Identify the latency cause
High latency is due to repeated database reads causing load spikes, which read replicas help but still hit the database.Step 2: Recognize caching benefits
An in-memory cache like Redis serves repeated reads from memory, drastically reducing latency and database load.Final Answer:
Option A -> Option AQuick Check:
Cache serves repeated reads faster than replicas [check]
Hint: Cache repeated reads to avoid DB spikes [check]
Common Mistakes:
4. Without a distributed consensus system (like Paxos or Raft) coordinating leader election, what exactly breaks in a system designed for 99.999% availability?
medium
Solution
Step 1: Role of distributed consensus in leader election
Consensus protocols ensure exactly one leader at a time, preventing split-brain scenarios.Step 2: Consequences of missing consensus
Without consensus, multiple nodes may act as leader simultaneously, causing conflicting writes and data corruption, breaking availability guarantees.Final Answer:
Option B -> Option BQuick Check:
No consensus -> split-brain -> conflicting writes -> data corruption [check]
Hint: No consensus -> split-brain -> conflicting writes break availability [check]
Common Mistakes:
5. For a real-time ML inference system requiring minimal latency and high availability during model updates, which architecture is preferable and why?
medium
Solution
Step 1: Evaluate architectures for latency and availability
Monolithic (A) and single server batch reload (C) block requests during reload, increasing latency. Client-side loading (D) adds complexity and inconsistent versions.Step 2: Understand blue-green deployment benefits
Blue-green (B) runs two clusters; new model loads on inactive cluster, then traffic switches atomically, ensuring zero downtime and minimal latency impact.Final Answer:
Option C -> Option CQuick Check:
Blue-green enables atomic switch with zero downtime [check]
Hint: Blue-green switches traffic atomically, avoiding reload blocking [OK]
Common Mistakes:
