Practice
Solution
Step 1: Understand Kafka's offset commit behavior
Kafka retains messages until consumers commit offsets. If the worker crashes before committing, messages remain available for reprocessing.Step 2: Analyze crash timing
Since the worker crashed before writing summaries and committing offsets, raw events remain in Kafka and will be reprocessed after restart.Final Answer:
Option A -> Option AQuick Check:
Kafka retains uncommitted messages for reprocessing [check]
Solution
Step 1: Analyze pure push fan-out (A)
Push to all followers synchronously causes huge write amplification for celebrities, increasing write latency and storage.Step 2: Analyze pure pull fan-out (C)
Pull reduces write cost but increases read latency and complexity for users with many followers.Step 3: Evaluate hybrid fan-out (B)
Hybrid pushes to users with many followers (to reduce read latency) and pulls for users with few followers (to reduce write amplification), balancing both latencies.Step 4: Evaluate push only for active users (D)
Activity-based push doesn't address follower count skew effectively.Final Answer:
Option C -> Option CQuick Check:
Hybrid fan-out balances write and read latency by follower count [check]
Solution
Step 1: Understand the role of stating assumptions
Explicit assumptions clarify scope and constraints, preventing misunderstandings.Step 2: Trace failure when assumptions are omitted
Without assumptions, interviewers may accept incomplete designs without challenge, missing flaws.Final Answer:
Option C -> Option CQuick Check:
Omitting assumptions leads to unchallenged flawed designs [check]
Solution
Step 1: Understand KMS role in key lifecycle
KMS generates and manages encryption keys; if unavailable, new keys can't be created but existing keys cached locally allow decryption.Step 2: Eliminate incorrect failure modes
Encryption doesn't stop immediately; decryption continues with cached keys; system does not fallback to unencrypted storage automatically.Final Answer:
Option A -> Option AQuick Check:
KMS outage blocks new key generation, existing keys still usable [check]
Solution
Step 1: Identify stateful bottlenecks at scale
Chat servers maintain stateful WebSocket connections bound to server memory, limiting horizontal scaling.Step 2: Compare other components' scalability
Databases can shard; load balancers can be scaled horizontally; queues can be partitioned and scaled with disk expansion.Final Answer:
Option D -> Option DQuick Check:
Stateful WebSocket servers -> resharding hard -> first bottleneck at 10x scale [check]
