Practice
1. In a system designed for 99.999% availability, at step 4 the Delivery Worker checks the message queue for pending retries. What happens if the message is not acknowledged by the consumer within the visibility timeout?
easy
Solution
Step 1: Trace Delivery Worker decision at Step 4 -- message visibility timeout
If the message is not acknowledged within the visibility timeout, it becomes visible again for redelivery to ensure no message loss.Step 2: Eliminate incorrect options
Immediate deletion (A) risks message loss; archiving without retry (C) breaks availability; blocking (D) reduces throughput and availability.Final Answer:
Option C -> Option CQuick Check:
Visibility timeout expiry -> message re-queued for retry [check]
Hint: Visibility timeout expiry -> message re-queued for retry [check]
Common Mistakes:
2. A real-time ML inference system must serve predictions with minimal latency while allowing safe model updates without downtime. Which component best enables seamless model rollout with instant rollback capability?
easy
Solution
Step 1: Identify deployment strategies for safe model updates
Batch inference (C) is offline and adds latency, so it doesn't support real-time rollout. Feature store (D) optimizes input features but doesn't handle rollout or rollback. A/B testing (A) splits live traffic, risking user experience if the new model is faulty.Step 2: Understand shadow mode benefits
Shadow mode (B) runs new models in parallel on live data without affecting production responses, enabling validation and instant rollback if issues arise.Final Answer:
Option A -> Option AQuick Check:
Shadow mode runs new models safely alongside production [check]
Hint: Shadow mode isolates new models without impacting live traffic [OK]
Common Mistakes:
3. In the URL shortener system, at step 5 the Redirect Service receives a short code and queries the Cache before the Database. What happens if the Cache lookup misses at this step?
easy
Solution
Step 1: Trace Redirect Service behavior at Cache miss
Cache miss means the short code is not in memory; the service must fetch the original URL from persistent storage.Step 2: Confirm Cache update after DB fetch
After retrieving from DB, the service updates the Cache to speed up future requests.Final Answer:
Option B -> Option BQuick Check:
Cache miss triggers DB lookup and Cache update [check]
Hint: Cache miss -> DB lookup -> Cache update [check]
Common Mistakes:
4. In a pub-sub system, at step 4 the Delivery Worker reads a message from the topic partition and checks the subscriber's offset. What happens if the subscriber's offset is behind the latest committed offset?
easy
Solution
Step 1: Understand subscriber offset semantics
The subscriber offset tracks the last consumed message. If behind, the Delivery Worker must deliver pending messages to catch up.Step 2: Delivery Worker behavior
It delivers the message at the subscriber's offset and then updates the offset to the next message. Skipping or deleting messages (Options A and C) breaks delivery guarantees. Blocking (The Delivery Worker blocks until the subscriber catches up) is unnecessary and stalls the system.Final Answer:
Option C -> Option CQuick Check:
Delivery Worker delivers and advances subscriber offset [check]
Hint: Subscriber offset behind -> deliver message and update offset [check]
Common Mistakes:
5. Without the message broker (e.g., Kafka) in a high-throughput chat system, what exactly breaks in the message delivery flow?
medium
Solution
Step 1: Role of message broker
Broker decouples sender and receiver, enabling asynchronous delivery and retries.Step 2: Consequence of missing broker
Without it, messages are sent synchronously causing sender blocking; if receiver crashes, messages are lost; encryption (A) unaffected; blocking and loss (C) is exact failure; batch mode (D) not automatic.Final Answer:
Option A -> Option AQuick Check:
Broker removal causes blocking sends and message loss on receiver failure [check]
Hint: No broker means synchronous sends block and lose messages [check]
Common Mistakes:
