Practice
Solution
Step 1: Identify eviction based on time expiration
TTL eviction removes cache entries strictly after a fixed time, independent of access patterns.Step 2: Eliminate other policies
LRU and LFU depend on access recency or frequency, not fixed time. ARC adapts between recency and frequency but does not enforce fixed expiration.Final Answer:
Option C -> Option CQuick Check:
TTL evicts by fixed time, ignoring usage patterns [check]
Solution
Step 1: Trace replica behavior at step 4
Replica applies WAL entries to its local store to catch up with primary.Step 2: Understand acknowledgment timing
Replica acknowledges primary only after applying entries to ensure durability and consistency.Final Answer:
Option B -> Option BQuick Check:
Replica applies then acknowledges -> ensures data durability [check]
Solution
Step 1: Trace API Gateway behavior at step 4
The API Gateway relies on the registry response to route requests; stale data leads to routing to unavailable instances.Step 2: Eliminate other options
The API Gateway retries the request until fresh data is received is incorrect as retries are not automatic; The API Gateway falls back to client-side discovery automatically is false since fallback is not built-in; The API Gateway caches the stale data but marks instances as unhealthy is incorrect because caching stale data without health checks causes failures.Final Answer:
Option A -> Option AQuick Check:
API Gateway routes based on stale registry data causing failures [check]
Solution
Step 1: Evaluate coordination and consistency trade-offs
Centralized locks (A) and linearizable transactions (C) impose coordination and reduce availability. Message queues with synchronous aggregation (D) add latency and bottlenecks.Step 2: Recognize sharded CRDT counters provide eventual consistency with no coordination
They allow concurrent increments and asynchronous merges, fitting minimal coordination and strong eventual consistency.Final Answer:
Option A -> Option AQuick Check:
Sharded CRDTs enable coordination-free eventual consistency [check]
Solution
Step 1: Analyze burst handling requirements
The system must avoid sudden bursts and enforce steady rate.Step 2: Compare algorithms
Token bucket allows bursts, fixed window counters reset counts causing bursts, sliding window logs allow spikes due to timestamp granularity.Final Answer:
Option C -> Option CQuick Check:
Leaky bucket enforces steady output rate, smoothing bursts [check]
