Practice
1. In a system using a Bloom filter to check key existence before disk read, at step 4 the Bloom filter component returns false positive for a key. What happens next?
easy
Solution
Step 1: Understand Bloom filter false positives
Bloom filters can yield false positives, meaning they may indicate a key exists when it does not.Step 2: Trace system behavior at step 4
Upon a positive Bloom filter result, the system must verify by disk lookup; however, the question states a false positive, so the system retries with a different hash function to reduce false positives before disk access.Final Answer:
Option A -> Option AQuick Check:
False positives trigger retries with alternate hashes before disk read [check]
Hint: False positive? Retry with different hash [check]
Common Mistakes:
2. A distributed messaging system processes millions of events per second. Some messages fail processing due to transient errors and must be retried without blocking the main queue. Which component best handles isolating these failed messages for later inspection and retry?
easy
Solution
Step 1: Identify the role of Dead Letter Queues
DLQs isolate failed messages from the main queue, enabling retries without blocking normal processing.Step 2: Evaluate alternatives
Relational DBs (A) add latency and complexity; Redis (C) lacks durability guarantees; load balancers (D) do not handle message state or retries.Final Answer:
Option A -> Option AQuick Check:
DLQ isolates failures for retry without blocking main queue [check]
Hint: Dead Letter Queues isolate failures, not caches or DBs [OK]
Common Mistakes:
3. A messaging system must handle 925K message writes per second and fan-out delivery to millions of users with minimal latency. Which component best decouples message ingestion from fan-out delivery to ensure durability and scalability?
easy
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]
Hint: Kafka partitions ensure durable, ordered, scalable ingestion [OK]
Common Mistakes:
4. In the message delivery trace, at Step 4 the Delivery Worker checks Bob's presence TTL in the presence service cache. What happens if Bob's presence TTL has expired at this step?
easy
Solution
Step 1: Trace Delivery Worker decision at Step 4 -- Bob's presence TTL
If Bob's presence TTL expired, Delivery Worker treats Bob as offline and queues message for offline storage.Step 2: Eliminate other options
Marking delivered without sending is incorrect; retrying indefinitely blocks delivery; sending regardless ignores offline status.Final Answer:
Option A -> Option AQuick Check:
Expired presence TTL -> queue for offline delivery [check]
Hint: Expired presence TTL means offline -> queue message [check]
Common Mistakes:
5. In the DNS resolution chain, at step 4 the recursive DNS server receives a referral response from the root server pointing to a TLD server. What state does the recursive server enter immediately after receiving this referral?
easy
Solution
Step 1: Understand recursive server behavior on referral
When the recursive DNS server receives a referral from the root server, it caches the referral information (the TLD server's IP) and then queries the TLD server itself.Step 2: Eliminate incorrect states
It does not cache the root server IP (already known), nor does it discard the referral or forward it directly to the client. The recursive server handles the full resolution chain transparently.Final Answer:
Option A -> Option AQuick Check:
Recursive server caches referral and queries next server [check]
Hint: Recursive server caches referrals and queries next hop [check]
Common Mistakes:
