Practice
1. 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:
2. Without a message queue like Kafka in a chat system, what exactly breaks in message delivery?
medium
Solution
Step 1: Role of Kafka in decoupling send and delivery
Kafka buffers messages asynchronously, preventing sender blocking on recipient availability.Step 2: Consequence of removing Kafka
Sender must synchronously wait for recipient response; if recipient crashes, message is lost with no retry.Final Answer:
Option A -> Option AQuick Check:
No queue causes synchronous blocking and message loss on recipient failure [check]
Hint: No queue means sender blocks and loses messages if recipient crashes [check]
Common Mistakes:
3. Which monitoring strategy best prevents failover incidents like GitHub's database crash by detecting anomalies early?
medium
Solution
Step 1: Importance of monitoring leader election
Real-time metrics detect leader election delays indicating failover issues early.Step 2: Evaluate other options
Manual checks (A) are slow; backup reports (C) don't catch live failover issues; client logs (D) lack centralized alerting.Final Answer:
Option C -> Option CQuick Check:
Real-time alerting enables proactive failover management [check]
Hint: Real-time alerts catch failover delays early
Common Mistakes:
4. You must implement a distributed lock for a system with high contention and strict latency requirements. Which approach is best and why?
medium
Solution
Step 1: Evaluate Redis SETNX under high contention
Redis SETNX with TTL (A) is fast but can cause split-brain and stale locks under network partitions, violating correctness.Step 2: Consider consensus-based lock service
Consensus-based services like etcd (B) provide strong consistency and fault tolerance, ensuring correctness even if latency is higher.Step 3: Assess database row locks and local locks
Database locks (C) have high latency and risk deadlocks; local locks (D) do not coordinate across nodes, failing correctness.Final Answer:
Option B -> Option BQuick Check:
Consensus ensures correctness under contention despite latency [check]
Hint: Consensus beats speed for correctness under contention [check]
Common Mistakes:
5. At 10x scale, which component in the webhook delivery system is most likely to fail first and why?
hard
Solution
Step 1: Identify stateful bottleneck at scale
Delivery Workers hold stateful connections (e.g., HTTP keep-alive) per subscriber, limiting resharding and horizontal scaling.Step 2: Compare other components
Databases can be sharded; load balancers scale horizontally; retry queues are usually distributed and scalable.Final Answer:
Option C -> Option CQuick Check:
Stateful Delivery Workers -> scaling bottleneck [check]
Hint: Stateful workers block scaling first [check]
Common Mistakes:
