Practice
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: Evaluate latency and consistency trade-offs
Global synchronous quorum to all regions (A) causes high latency; asynchronous (B) sacrifices strong consistency.Step 2: Consider local quorum with global reconciliation
Local quorum writes reduce latency while global reconciliation maintains strong consistency.Final Answer:
Option D -> Option DQuick Check:
Local quorum + global reconciliation balances latency and consistency [check]
Solution
Step 1: Understand cache invalidation role
Cache invalidation ensures edge caches update stale content after new video versions publish.Step 2: Trace failure without invalidation
Without invalidation, edge caches keep serving stale content (Some users continue to receive stale video chunks causing playback errors), but more critically, clients request fresh content repeatedly, causing origin overload (The origin server crashes due to excessive cache refresh requests). Immediate degraded quality (Users immediately see the new version but with degraded quality) or complete stop (Video streaming stops completely until manual cache reset) do not occur.Final Answer:
Option D -> Option DQuick Check:
Origin overload from repeated cache misses crashes server [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]
Solution
Step 1: Analyze scale impact on components
Global aggregator (A) merges asynchronously, so less likely bottleneck. Replication overhead (C) grows but can be optimized. Client counters (D) can compact state.Step 2: Identify shard replicas failure mode
At 10x scale, network partitions increase, causing shards to diverge permanently without reconciliation, breaking eventual consistency.Final Answer:
Option A -> Option AQuick Check:
Network partitions cause shard divergence first at scale [check]
