Practice
Solution
Step 1: Identify the cause of thundering herd
Multiple clients request the same expired cache key simultaneously, causing backend overload.Step 2: Evaluate prevention strategies
Distributed locks or mutexes ensure only one client regenerates the cache, preventing backend overload.Final Answer:
Option A -> Option AQuick Check:
Distributed locking serializes cache regeneration, preventing thundering herd [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: Identify Kafka's role in decoupling ingestion and delivery
Kafka partitions by conversation ID to guarantee ordering and durability, allowing high write throughput and asynchronous fan-out.Step 2: Eliminate other options
Relational DB with locking can't handle high write concurrency; Redis pub/sub lacks durability and persistence; HTTP polling adds latency and load.Final Answer:
Option D -> Option DQuick Check:
Kafka partitions -> durable, ordered, scalable message ingestion [check]
Solution
Step 1: Identify bottleneck at scale
Edge routers handle packet forwarding at line rate; at 10x traffic, their CPU and forwarding ASICs are stressed first.Step 2: Evaluate other components
Route reflectors (A) scale better with hierarchical design; monitoring systems (C) can be scaled horizontally; client devices (D) are downstream and less critical for routing stability.Final Answer:
Option A -> Option AQuick Check:
Edge routers' CPU overload causes first failure at 10x traffic [check]
Solution
Step 1: Analyze statefulness and scalability
Trie servers hold large in-memory state and are difficult to shard due to pointer-based node structures, limiting horizontal scaling.Step 2: Compare other components
Elasticsearch scales horizontally with shards; prefix hash map can be partitioned or replaced; client UI is less likely the first bottleneck at backend scale.Final Answer:
Option A -> Option AQuick Check:
Trie statefulness limits sharding -> bottleneck at scale [check]
