Practice
1. A system must handle millions of short video uploads per day, ensuring fast ingestion and metadata extraction without blocking the user. Which component is best suited to decouple upload ingestion from processing?
easy
Solution
Step 1: Identify ingestion decoupling need
Relational DB (A) blocks user upload due to synchronous writes; CDN (C) caches for delivery, not ingestion; REST API (D) triggers blocking transcoding.Step 2: Choose buffering component
Kafka (B) buffers uploads asynchronously, enabling fast user response and reliable processing.Final Answer:
Option A -> Option AQuick Check:
Kafka buffers uploads asynchronously for scalable ingestion [check]
Hint: Buffer uploads asynchronously with Kafka queue [OK]
Common Mistakes:
2. In a distributed cache using consistent hashing, at Step 4 the Cache Node receives a key lookup request. What happens if the node does not have the key locally?
easy
Solution
Step 1: Trace key lookup at Cache Node
If the node lacks the key, it must find the correct node responsible for that key using the consistent hash ring.Step 2: Forwarding via consistent hash ring
The node consults the hash ring to identify the node owning the key and forwards the request there; centralized metadata (The node queries a centralized metadata service for key location) adds latency and single point of failure; broadcasting (The node broadcasts the request to all other cache nodes) is inefficient.Final Answer:
Option B -> Option BQuick Check:
Consistent hash ring lookup enables correct node forwarding [check]
Hint: Cache miss triggers consistent hash ring forwarding [check]
Common Mistakes:
3. For a high-throughput payment processing system, which approach best balances failure isolation and resource utilization?
medium
Solution
Step 1: Evaluate shared thread pool risks
A single shared pool (A) risks cascading failures; circuit breakers (C) detect failures but don't isolate resource exhaustion. Autoscaling (D) reacts late and may not prevent blast radius.Step 2: Assess bulkhead benefits
Bulkheads (B) isolate failures per payment type, preventing one type's overload from affecting others, balancing isolation and utilization.Final Answer:
Option A -> Option AQuick Check:
Bulkheads isolate failures per resource partition [check]
Hint: Bulkheads isolate by partitioning resources per failure domain [check]
Common Mistakes:
4. For a mobile client calling a flaky backend service, which approach best balances responsiveness and failure isolation?
medium
Solution
Step 1: Evaluate synchronous retries (A)
Retries increase latency and risk cascading failures, bad for mobile responsiveness.Step 2: Compare asynchronous queue (C) and caching (D)
Queues add delay and complexity; caching avoids calls but may serve stale data, not ideal for dynamic data.Step 3: Circuit breaker with short timeout and fallback (B)
Provides quick failure detection, prevents cascading failures, and returns fallback to maintain responsiveness.Final Answer:
Option C -> Option CQuick Check:
Circuit breaker with fallback balances isolation and responsiveness [check]
Hint: Circuit breaker with fallback keeps mobile responsive and isolated [OK]
Common Mistakes:
5. If the machine ID component is misconfigured and two machines generate Snowflake IDs with the same machine ID simultaneously, what is the most likely failure mode?
medium
Solution
Step 1: Understand machine ID role in uniqueness
Machine ID differentiates ID generators on different machines; same machine ID risks collisions.Step 2: Analyze collision handling
Different timestamps alone (A) do not guarantee uniqueness if clocks are synchronized; sequence number does not auto-adjust across machines (C is incorrect). System does not detect conflicts automatically (D).Step 3: Correct failure mode
Duplicate IDs are generated if machine IDs collide, causing data corruption or overwrite.Final Answer:
Option A -> Option AQuick Check:
Same machine ID + same timestamp -> duplicate IDs and data corruption [check]
Hint: Same machine ID causes duplicate IDs, no auto correction [OK]
Common Mistakes:
