Practice
Solution
Step 1: Trace Feed Worker behavior at cache miss
When TTL expires, the cache is stale. The Feed Worker must avoid blocking feed generation.Step 2: Understand asynchronous cache refresh
To maintain low latency, the Feed Worker returns empty stories immediately and triggers async cache refresh. Blocking fetch (B) would increase latency. Returning stale data (A) risks outdated content. Skipping stories silently (C) loses user experience.Final Answer:
Option A -> Option AQuick Check:
Async cache refresh avoids blocking feed generation [check]
Solution
Step 1: Trace request router behavior at Step 4
The router uses the key's hash to find the closest virtual node clockwise on the ring.Step 2: Map virtual node to physical node
Each virtual node maps to a physical node; the router routes the request accordingly.Final Answer:
Option A -> Option AQuick Check:
Consistent hashing uses clockwise virtual node lookup to find physical node [check]
Solution
Step 1: Trace cache invalidation at step 4
Cache invalidation is asynchronous and best-effort; failure does not rollback DB writes.Step 2: Understand failure impact on cache state
If invalidation fails, Redis cache remains stale until TTL expiry or next explicit refresh.Final Answer:
Option C -> Option CQuick Check:
Failed cache invalidation -> stale cache until TTL or manual refresh [check]
Solution
Step 1: Analyze cron scheduler scalability
Cron schedulers are typically lightweight and can be sharded or distributed; unlikely to bottleneck first (A).Step 2: Analyze worker node resource limits
Workers scale horizontally; CPU exhaustion (C) is mitigated by adding nodes.Step 3: Analyze network load balancer capacity
Load balancers scale with standard techniques; connection count (D) is manageable.Step 4: Analyze distributed priority queue bottlenecks
Priority queue faces contention on ordering, lease renewals, and coordination overhead, which grows non-linearly with scale, causing it to bottleneck first (B).Final Answer:
Option D -> Option DQuick Check:
Priority queue contention and lease overhead limit scale first [check]
Solution
Step 1: Identify bottleneck at 10x DAU scale
DAU Estimator must track millions of active users in real-time, requiring heavy aggregation and state management.Step 2: Eliminate other options
Storage Estimator scales with disk but can be sharded; Bandwidth Estimator aggregates metrics but less stateful; QPS Estimator uses load balancer metrics which scale better.Final Answer:
Option C -> Option CQuick Check:
Real-time DAU tracking state grows fastest, causing bottleneck [check]
