Practice
Solution
Step 1: Understand LFU eviction criteria
LFU evicts the cache entry with the lowest access frequency to keep frequently used items.Step 2: Analyze eviction candidate state at step 4
The candidate selected for eviction must have the lowest frequency count; frequency is not reset or ignored.Final Answer:
Option D -> Option DQuick Check:
LFU evicts lowest frequency count keys [check]
Solution
Step 1: Identify Kafka's role in event sourcing
Kafka supports high throughput with partitioning by aggregate ID, ensuring ordered event processing per aggregate.Step 2: Evaluate other options
Redis pub/sub lacks durability guarantees; relational DB triggers don't scale to 1M events/sec; RabbitMQ's round-robin breaks ordering per aggregate.Final Answer:
Option B -> Option BQuick Check:
Kafka partitions by aggregate ID -> ordered, durable event stream [check]
Solution
Step 1: Understand rollback absence impact
Without rollback, faulty Canary version cannot be reverted automatically.Step 2: Trace failure effect
Faulty version remains live, causing degraded user experience indefinitely.Final Answer:
Option A -> Option AQuick Check:
No rollback -> faulty version stays live -> degraded service persists [check]
Solution
Step 1: Understand queue's role in message deduplication and buffering
Queues often provide deduplication and buffering to ensure exactly-once or at-least-once delivery.Step 2: Consequence of removing the queue
Without the queue, messages may be duplicated due to lack of deduplication and buffering mechanisms.Final Answer:
Option B -> Option BQuick Check:
Removing queue causes message duplication due to missing deduplication [check]
Solution
Step 1: Identify requirements
High throughput, sortable, unique IDs across regions with minimal coordination.Step 2: Evaluate options
UUIDv4 (A) is unique but not sortable; centralized auto-increment (C) causes bottlenecks; independent auto-increment (D) risks collisions; Snowflake-style IDs (B) embed timestamp and region, enabling sortable, unique IDs with decentralized generation.Final Answer:
Option A -> Option AQuick Check:
Snowflake IDs -> sortable, unique, decentralized [check]
