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 typeahead autocomplete system using a Trie, at step 3 the user input 'app' is processed. What does the Trie component do at this step?
easy
Solution
Step 1: Understand Trie traversal for prefix lookup
The Trie component traverses nodes for each character in the prefix, here 'a' -> 'p' -> 'p', to reach the subtree containing all words starting with 'app'.Step 2: Eliminate other options
Full scan is inefficient and not how Trie works; Elasticsearch and prefix hash map are separate components, not involved at this step.Final Answer:
Option D -> Option DQuick Check:
Trie traversal follows prefix characters to subtree [check]
Hint: Trie lookup = follow prefix nodes step-by-step [check]
Common Mistakes:
3. A web application receives millions of HTTP requests per second and needs to distribute them evenly across multiple backend servers to avoid overload. Which component is primarily responsible for this task?
easy
Solution
Step 1: Identify the component that distributes traffic
A DNS server (A DNS server that resolves domain names to IP addresses) only resolves domain names and does not balance load dynamically. A caching proxy (A caching proxy that stores frequently accessed responses) serves cached content but does not distribute load evenly. A message queue (A message queue that buffers incoming requests for asynchronous processing) buffers requests asynchronously but does not route live HTTP requests to backend servers.Step 2: Understand load balancer role
A load balancer (A load balancer that routes requests based on server health and capacity) routes incoming requests to backend servers based on health checks and capacity, preventing overload and ensuring even distribution.Final Answer:
Option C -> Option CQuick Check:
Load balancer routes requests evenly based on server health [check]
Hint: Load balancer routes live traffic evenly [check]
Common Mistakes:
4. If the Key Management Service (KMS) becomes unavailable, what exactly breaks in the system's encryption-at-rest workflow?
medium
Solution
Step 1: Understand KMS role in key lifecycle
KMS generates and manages encryption keys; if unavailable, new keys can't be created but existing keys cached locally allow decryption.Step 2: Eliminate incorrect failure modes
Encryption doesn't stop immediately; decryption continues with cached keys; system does not fallback to unencrypted storage automatically.Final Answer:
Option A -> Option AQuick Check:
KMS outage blocks new key generation, existing keys still usable [check]
Hint: KMS down -> no new keys, existing keys still decrypt [check]
Common Mistakes:
5. At 10x scale of concurrent users, which component in a typeahead autocomplete system using Elasticsearch and Trie is most likely to become the bottleneck first, and why?
hard
Solution
Step 1: Analyze statefulness and scalability
Trie servers hold large in-memory state and are difficult to shard due to pointer-based node structures, limiting horizontal scaling.Step 2: Compare other components
Elasticsearch scales horizontally with shards; prefix hash map can be partitioned or replaced; client UI is less likely the first bottleneck at backend scale.Final Answer:
Option A -> Option AQuick Check:
Trie statefulness limits sharding -> bottleneck at scale [check]
Hint: Trie stateful, hard to shard -> first bottleneck at scale [check]
Common Mistakes:
