Practice
1. In a distributed counter system using sharded CRDTs, at Step 4 the Aggregator node merges shard states received from replicas. What is the Aggregator's state immediately after merging two shards with counts 100 and 150?
easy
Solution
Step 1: Understand CRDT merge semantics for counters
Sharded counters merge by summing counts from each shard to reflect total increments without double counting.Step 2: Apply merge to counts 100 and 150
Sum is 250, representing combined increments from both shards.Final Answer:
Option C -> Option CQuick Check:
CRDT counters merge by summing shard values [check]
Hint: CRDT counters merge by summing shard counts [check]
Common Mistakes:
2. A distributed API rate limiter must enforce limits with minimal latency at the network edge. Which component is best suited to perform this enforcement?
easy
Solution
Step 1: Identify edge enforcement needs
Enforcement must be low-latency and close to the client to avoid network round trips.Step 2: Evaluate options for latency and consistency
Centralized DB (A) adds latency; batch jobs (C) are too delayed; client SDK (D) is untrustworthy. Edge cache with local counters (B) balances latency and eventual consistency.Final Answer:
Option B -> Option BQuick Check:
Edge cache enforces limits locally with periodic sync [check]
Hint: Enforce limits close to client with local counters [check]
Common Mistakes:
3. In the file sync system's upload flow, at Step 4 the Delta Upload Worker receives chunk hashes from the client. What does the worker do when it finds a chunk hash already stored on the server?
easy
Solution
Step 1: Trace Delta Upload Worker behavior at Step 4
When the worker finds a chunk hash already stored, it skips re-uploading the chunk to save bandwidth and marks it as present.Step 2: Eliminate incorrect behaviors
Requesting resend wastes bandwidth; deleting existing chunks breaks deduplication; re-chunking is unrelated to upload step.Final Answer:
Option A -> Option AQuick Check:
Delta Upload Worker skips existing chunks to avoid redundant upload [check]
Hint: Skip chunks with known hashes to save bandwidth [check]
Common Mistakes:
4. If the Kafka cluster used for fan-out events crashes and loses the latest messages, what exactly breaks in the newsfeed delivery?
medium
Solution
Step 1: Understand Kafka's role in fan-out
Kafka buffers fan-out events; Delivery Workers consume from Kafka to deliver posts asynchronously.Step 2: Trace failure impact
If Kafka crashes and loses messages, Delivery Workers waiting on those messages block or stall, causing delivery delays.Step 3: Eliminate other options
Duplicates (A) occur with retries, not loss. Lost posts (B) happen but are not the immediate failure mode. Fallback to synchronous push (D) is not automatic.Final Answer:
Option D -> Option DQuick Check:
Kafka crash causes Delivery Workers to block waiting for lost messages [check]
Hint: Kafka crash blocks Delivery Workers waiting for messages [check]
Common Mistakes:
5. At 10x scale, which component in a real-time chat system implementing CAP theorem fails first and why?
hard
Solution
Step 1: Identify stateful bottleneck
Chat servers maintain WebSocket connections statefully, limiting horizontal scaling.Step 2: Understand scaling impact
At 10x scale, existing WebSocket connections cannot be moved, causing chat servers to saturate first.Final Answer:
Option C -> Option CQuick Check:
Stateful WebSocket servers bottleneck scaling before DB or load balancer [check]
Hint: Stateful WebSocket servers bottleneck scaling first [check]
Common Mistakes:
