Practice
1. If the purge API service in a CDN is down, what exactly breaks in the cache invalidation process?
medium
Solution
Step 1: Identify purge API role
Purge API triggers immediate invalidation; TTL expirations are independent and continue.Step 2: Analyze failure impact
Without purge API, manual or programmatic immediate invalidations fail; TTL still expires cache eventually; surrogate key invalidations may be separate.Final Answer:
Option C -> Option CQuick Check:
TTL expirations unaffected; purge requests fail causing delayed invalidation [check]
Hint: Purge API down blocks immediate invalidation, TTL still expires [check]
Common Mistakes:
2. In a primary-replica system, what exactly breaks if the replication log (WAL) on the primary is lost before being sent to replicas?
medium
Solution
Step 1: Understand WAL role in replication
WAL is the source of truth for replicas to catch up incrementally.Step 2: Trace failure impact
If WAL is lost, replicas cannot catch up incrementally and must request full snapshot, causing load and delay.Final Answer:
Option A -> Option AQuick Check:
Lost WAL -> replicas request full snapshot -> recovery delay [check]
Hint: Lost WAL -> full snapshot fetch delays recovery [check]
Common Mistakes:
3. For a global API rate limiter with strict per-user limits, which architecture best balances consistency and latency?
medium
Solution
Step 1: Analyze consistency and latency needs
Strict per-user limits require consistent counters with low latency.Step 2: Evaluate architectures
Centralized Redis (A) is a bottleneck; client-side counters (C) are eventually consistent and unreliable; distributed SQL (D) has high latency. Sharded Redis with consistent hashing (B) balances load and maintains per-user consistency.Final Answer:
Option C -> Option CQuick Check:
Sharded Redis cluster scales with consistent hashing per user [check]
Hint: Shard counters by user ID for scalable consistency [check]
Common Mistakes:
4. Without the shard-level cache in the faceted search system, what exactly breaks during high query load spikes?
medium
Solution
Step 1: Understand shard-level cache role
The cache reduces load on shard nodes by serving frequent queries quickly, preventing overload during spikes.Step 2: Trace failure without cache
Without cache, all queries hit shard nodes directly, causing CPU and I/O overload, increasing latency and timeouts.Final Answer:
Option B -> Option BQuick Check:
Cache absence -> shard overload -> latency spikes [check]
Hint: No cache -> shard overload -> latency spikes [check]
Common Mistakes:
5. At 10x scale, which Pastebin component is most likely to fail first and why?
hard
Solution
Step 1: Analyze scaling bottlenecks
Expiration Worker scans all snippets to delete expired ones; at 10x scale, scan latency grows linearly.Step 2: Compare other components
Relational DB (A) is not primary storage; key-value stores (C) shard well; Kafka (D) scales with partitioning but expiration scanning is a linear bottleneck.Final Answer:
Option C -> Option CQuick Check:
Expiration scanning is linear and slows down first at scale [check]
Hint: Expiration scanning scales linearly, fails first at 10x [check]
Common Mistakes:
