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. A web API must limit incoming requests to 100 per second with bursts allowed up to 200 requests. Which component best enforces this rate limiting with burst handling?
easy
Solution
Step 1: Identify rate limiting with burst support
The token bucket algorithm allows tokens to accumulate up to a max bucket size, enabling bursts beyond the steady refill rate.Step 2: Eliminate other options
Fixed window counters cause spikes at window boundaries and don't handle bursts well. Leaky bucket smooths traffic but disallows bursts. Simple queues drop excess requests without rate control.Final Answer:
Option D -> Option DQuick Check:
Token bucket allows bursts by token accumulation [check]
Hint: Token bucket = steady refill + burst capacity [OK]
Common Mistakes:
3. Without a consistent hashing function in a hash-based sharding system, what exact failure occurs when a new shard is added?
medium
Solution
Step 1: Understand consistent hashing role
Consistent hashing minimizes key remapping when shards change.Step 2: Trace failure without consistent hashing
Adding a shard requires rehashing all keys, moving massive data, causing downtime and routing inconsistencies.Final Answer:
Option D -> Option DQuick Check:
Without consistent hashing, shard addition triggers full rehash and data move [check]
Hint: Consistent hashing avoids full rehash on shard changes [check]
Common Mistakes:
4. If the prefix hash map component fails and becomes unavailable, what is the immediate impact on the autocomplete system's behavior?
medium
Solution
Step 1: Understand component roles
The prefix hash map is an optimization for O(1) prefix lookups, but the Trie is the primary data structure for prefix matching.Step 2: Trace failure impact
If the prefix hash map fails, the system falls back to the Trie for prefix queries, which still works but may have slightly higher latency.Final Answer:
Option B -> Option BQuick Check:
Trie fallback ensures prefix queries continue despite prefix hash map failure [check]
Hint: Trie fallback keeps prefix search alive if prefix hash fails [check]
Common Mistakes:
5. At 10x current scale, which component in the YouTube view count system is most likely to fail first, and why?
hard
Solution
Step 1: Analyze component scalability at 10x load
CDN edge caches (A) scale horizontally and are designed for massive read throughput. Transcoding pipeline (C) can be scaled with more workers. Upload service (D) can be scaled with load balancers and stateless servers.Step 2: Identify view count database bottleneck
View count DB is a centralized write hotspot with high contention and latency sensitivity. At 10x scale, it becomes the first bottleneck due to write amplification and consistency requirements.Final Answer:
Option B -> Option BQuick Check:
Centralized view count DB write bottleneck fails first [check]
Hint: Centralized DB write bottleneck breaks first at scale [check]
Common Mistakes:
