Practice
Solution
Step 1: Trace Distributed Counter behavior at Step 4
The counter checks if the increment would exceed the limit; if yes, it rejects the request immediately.Step 2: Eliminate incorrect states
Allowing increment with warning (B) breaks enforcement; delaying increment (C) causes inconsistent state; forwarding (D) adds complexity and is not standard.Final Answer:
Option A -> Option AQuick Check:
Counter rejects requests exceeding limit immediately [check]
Solution
Step 1: Understand Kafka offset commit semantics
Kafka consumers commit offsets only after processing messages successfully to avoid reprocessing.Step 2: Delivery Worker behavior on acknowledgment
Upon downstream acknowledgment, the worker marks the message as delivered and commits the offset, signaling safe processing.Final Answer:
Option C -> Option CQuick Check:
Offset commit after acknowledgment ensures exactly-once processing [check]
Solution
Step 1: Trace failure impact of authentication service crash
Without the authentication service, the gateway cannot verify credentials and may default to allowing requests through if no fail-closed mechanism is implemented.Step 2: Evaluate other options
Clients receive a 500 Internal Server Error due to gateway crash is unlikely as gateway remains up. Clients receive a 401 Unauthorized response because authentication cannot be verified requires fail-closed design, which is not always implemented. Requests queue indefinitely at the gateway until authentication service recovers causes indefinite blocking, which is rare.Final Answer:
Option C -> Option CQuick Check:
Auth service down -> requests pass unverified if no fail-closed [check]
Solution
Step 1: Understand reverse proxy SSL termination failure
If the reverse proxy crashes, SSL termination stops, so backend servers receive unencrypted traffic if clients connect directly or fallback occurs.Step 2: Eliminate other options
Clients cannot connect directly if proxy is mandatory; SSL handshake fails only if proxy blocks connection; proxy can't forward encrypted requests without decrypting if crashed.Final Answer:
Option C -> Option CQuick Check:
Reverse proxy crash exposes backend to unencrypted traffic [check]
Solution
Step 1: Role of message queue in gRPC server
The queue buffers messages for slow or disconnected clients, enabling retries and flow control.Step 2: Effect of removing the queue
Without the queue, messages sent to slow/disconnected clients are dropped immediately, causing message loss without retries.Final Answer:
Option C -> Option CQuick Check:
No queue -> message loss on slow/disconnected clients [check]
