Practice
Solution
Step 1: Identify the role of Dead Letter Queues
DLQs isolate failed messages from the main queue, enabling retries without blocking normal processing.Step 2: Evaluate alternatives
Relational DBs (A) add latency and complexity; Redis (C) lacks durability guarantees; load balancers (D) do not handle message state or retries.Final Answer:
Option A -> Option AQuick Check:
DLQ isolates failures for retry without blocking main queue [check]
Solution
Step 1: Trace Seat Locking Service behavior at Step 4
The service queries the distributed cache for the seat lock key with TTL.Step 2: Understand TTL expiration effect
If the TTL expired, the lock key is removed, so the service sees no lock and treats the seat as free.Final Answer:
Option A -> Option AQuick Check:
Expired TTL means no lock key -> seat available [check]
Solution
Step 1: Analyze availability and partition tolerance needs
Eventual consistency with asynchronous replication maximizes availability during partitions, tolerating temporary inconsistencies.Step 2: Compare with other models
Strong consistency blocks during partitions; causal consistency adds overhead and complexity not needed here; read-your-writes focuses on client guarantees, not global availability.Final Answer:
Option A -> Option AQuick Check:
Eventual consistency favors availability and partition tolerance [check]
Solution
Step 1: Analyze retry strategies for latency and reliability
Scheduled retries with delayed queues (B) balance retry timing and system load, reducing hot loops.Step 2: Evaluate other options
Immediate retries (A) risk overload; manual retries (C) add latency; infinite retries (D) cause resource exhaustion.Final Answer:
Option C -> Option CQuick Check:
Delayed queue retries balance latency and failure handling [check]
Solution
Step 1: Identify scaling challenges
Rate limiting often relies on centralized counters or stores (e.g., Redis) that become contention points under high request rates.Step 2: Eliminate other options
Backend microservices, because they cannot horizontally scale as easily as the gateway is incorrect as backend services typically scale horizontally. API Gateway routing logic, because routing tables grow exponentially with services is unlikely as routing tables are cached and optimized. Authentication service, because token validation is CPU-intensive and stateful is less likely as token validation is stateless and can be cached.Final Answer:
Option A -> Option AQuick Check:
Centralized rate limiting store bottlenecks first at scale [check]
