Practice
1. In a directory-based sharding system, at step 3 the Shard Lookup Service receives a request for user ID 12345. What happens next?
easy
Solution
Step 1: Understand directory-based sharding
Directory-based sharding uses a centralized mapping from keys to shards.Step 2: Trace step 3 action
The Shard Lookup Service consults the directory to find the exact shard for user ID 12345.Final Answer:
Option A -> Option AQuick Check:
Directory lookup returns shard for specific key [check]
Hint: Directory sharding uses centralized map to find shard [check]
Common Mistakes:
2. In a message delivery system, at Step 4 the Delivery Worker reads the message offset from Kafka and attempts to deliver it to the consumer. What happens if the consumer's acknowledgment is not received within the configured timeout?
easy
Solution
Step 1: Understand Kafka offset commit semantics
Kafka commits offsets only after successful acknowledgment to avoid message loss.Step 2: Delivery Worker behavior on missing ack
If no ack is received, the worker retries delivery to ensure at-least-once semantics; it does not commit offset or discard messages.Final Answer:
Option A -> Option AQuick Check:
Retries without committing offset -> ensures message redelivery [check]
Hint: No ack -> retry delivery, no offset commit [OK]
Common Mistakes:
3. For a system requiring both low latency and strong consistency in user profile updates, which architecture choice best balances these constraints?
medium
Solution
Step 1: Identify consistency and latency requirements
Strong consistency requires synchronous replication; low latency demands minimal delay.Step 2: Evaluate architecture options
Single primary DB with sync replication ensures consistency but may increase latency slightly; best trade-off.Final Answer:
Option B -> Option BQuick Check:
Synchronous replication balances strong consistency and latency [check]
Hint: Strong consistency needs sync replication, not eventual or cache-only [check]
Common Mistakes:
4. For a system tracking SLO error budgets with high write volume and low latency requirements, which architecture is best suited to ensure accurate, near real-time error budget updates?
medium
Solution
Step 1: Analyze latency and accuracy requirements
Near real-time updates require continuous stream processing rather than batch or polling.Step 2: Evaluate each architecture against these requirements
Batch processing (A) and hourly rollups (D) are too slow; polling (C) introduces latency and load spikes; stream processing (B) provides continuous, low-latency computation.Final Answer:
Option C -> Option CQuick Check:
Stream processing -> continuous, low-latency error budget updates [check]
Hint: Stream processing fits low latency and high write volume best [OK]
Common Mistakes:
5. At 10x scale, which component in the Redlock system is most likely to fail first and why?
hard
Solution
Step 1: Identify bottleneck at 10x scale
Increased lock requests increase network latency and contention on clients acquiring locks.Step 2: Analyze impact on lock acquisition
Higher latency causes clients to miss lock acquisition timeouts, reducing throughput and increasing retries.Step 3: Compare other components
Redis masters scale better with sharding; network links and timers less likely first failure.Final Answer:
Option D -> Option DQuick Check:
Clients hit network latency -> lock timeouts -> first failure at scale [check]
Hint: Clients face latency -> lock timeouts -> first failure at scale [check]
Common Mistakes:
