Practice
1. In the request flow, at Step 4 the Delivery Worker checks the message queue's visibility timeout before processing. What happens if the visibility timeout expires before the message is acknowledged?
easy
Solution
Step 1: Understand visibility timeout semantics
Visibility timeout hides the message during processing; if not acknowledged, it reappears for redelivery.Step 2: Analyze options
Immediate deletion (A) risks data loss; archiving without retry (C) prevents recovery; dead-letter queue (D) is for failed retries, not timeout expiry.Final Answer:
Option D -> Option DQuick Check:
Visibility timeout expiry -> message reappears for retry [check]
Hint: Visibility timeout expiry -> message requeued for retry [check]
Common Mistakes:
2. In a distributed lock system using ZooKeeper, at step 4 the client attempts to acquire the lock by creating an ephemeral sequential node. What happens if the client crashes immediately after creating this node but before confirming lock ownership?
easy
Solution
Step 1: Understand ephemeral node semantics
Ephemeral nodes in ZooKeeper are automatically deleted when the client session ends (e.g., crash), preventing deadlocks (A) and stale locks.Step 2: Trace lock ownership after crash
Since the ephemeral node is deleted, the next client waiting for the lock will be notified, but the lock is not immediately transferred (D) until they acquire it explicitly.Final Answer:
Option A -> Option AQuick Check:
Ephemeral node deletion on client crash -> lock released [check]
Hint: Ephemeral nodes vanish on client crash, freeing locks [check]
Common Mistakes:
3. If the prefix hash map component fails and becomes unavailable, what is the immediate impact on the autocomplete system's behavior?
medium
Solution
Step 1: Understand component roles
The prefix hash map is an optimization for O(1) prefix lookups, but the Trie is the primary data structure for prefix matching.Step 2: Trace failure impact
If the prefix hash map fails, the system falls back to the Trie for prefix queries, which still works but may have slightly higher latency.Final Answer:
Option B -> Option BQuick Check:
Trie fallback ensures prefix queries continue despite prefix hash map failure [check]
Hint: Trie fallback keeps prefix search alive if prefix hash fails [check]
Common Mistakes:
4. At 10x scale, which component is most likely to fail first and why when estimating system bandwidth for a social media platform with rapidly growing DAU?
hard
Solution
Step 1: Identify bottleneck at 10x DAU scale
DAU Estimator must track millions of active users in real-time, requiring heavy aggregation and state management.Step 2: Eliminate other options
Storage Estimator scales with disk but can be sharded; Bandwidth Estimator aggregates metrics but less stateful; QPS Estimator uses load balancer metrics which scale better.Final Answer:
Option C -> Option CQuick Check:
Real-time DAU tracking state grows fastest, causing bottleneck [check]
Hint: Real-time DAU tracking state grows fastest at scale [check]
Common Mistakes:
5. At 10x traffic scale, which component in a Layer 7 load balancing architecture is most likely to become the bottleneck first, and why?
hard
Solution
Step 1: Identify Layer 7 load balancer workload at scale
Layer 7 load balancers perform CPU-intensive tasks like HTTP header parsing and SSL termination, which scale poorly with traffic.Step 2: Compare with other components
Backend servers can be scaled horizontally; network switches handle packet forwarding efficiently; DNS servers are less impacted by traffic volume.Final Answer:
Option A -> Option AQuick Check:
Layer 7 LB CPU bottleneck due to HTTP parsing and SSL termination [check]
Hint: Layer 7 LB CPU chokes first at high traffic scale [check]
Common Mistakes:
