Practice
1. A database needs to support range queries on a large numeric column with frequent inserts and updates. Which indexing method best supports efficient range scans while maintaining balanced tree structure?
easy
Solution
Step 1: Identify index type for range queries
B-Tree indexes maintain sorted order of keys, enabling efficient range scans by traversing leaf nodes sequentially.Step 2: Eliminate other options
Hash indexes do not preserve order, so range queries require scanning all buckets. Composite indexes optimize multi-column equality but don't inherently improve single-column range scans. Bitmap indexes are efficient for low-cardinality columns, not large numeric ranges.Final Answer:
Option C -> Option CQuick Check:
B-Tree supports ordered traversal for range queries [check]
Hint: B-Tree keeps keys sorted for range queries [check]
Common Mistakes:
2. In the DNS query flow, at step 3 the GeoDNS server receives a DNS request from a user in Europe. What does the GeoDNS server do at this step?
easy
Solution
Step 1: Understand GeoDNS behavior at step 3
GeoDNS inspects the user's IP to determine geographic location and returns the IP of the nearest data center accordingly.Step 2: Rule out other options
Forwarding without modification (B) ignores GeoDNS's purpose. Caching regardless of location (C) breaks geographic routing. Health checks (D) are done asynchronously, not per query.Final Answer:
Option A -> Option AQuick Check:
GeoDNS returns location-based IP at query time [check]
Hint: GeoDNS returns nearest IP based on client IP at query [check]
Common Mistakes:
3. In a consistent hashing system with virtual nodes, at Step 4 the request router receives a key and must find the responsible physical node. What happens at this step?
easy
Solution
Step 1: Trace request router behavior at Step 4
The router uses the key's hash to find the closest virtual node clockwise on the ring.Step 2: Map virtual node to physical node
Each virtual node maps to a physical node; the router routes the request accordingly.Final Answer:
Option A -> Option AQuick Check:
Consistent hashing uses clockwise virtual node lookup to find physical node [check]
Hint: Hash key -> closest clockwise virtual node -> physical node [check]
Common Mistakes:
4. You must choose between a centralized logging system and a distributed tracing system to debug a latency spike affecting only a subset of microservices. Which is the better choice and why?
medium
Solution
Step 1: Identify the debugging need for latency spike localization
Tracing provides end-to-end request paths, revealing which microservices cause latency.Step 2: Eliminate logging options
Logging stores events but doesn't easily correlate distributed latency; it's not optimized for path visualization or bottleneck pinpointing.Final Answer:
Option A -> Option AQuick Check:
Tracing visualizes request paths to find latency hotspots [check]
Hint: Tracing maps request paths; logs record events [check]
Common Mistakes:
5. If the API Gateway's rate limiting cache fails and is not replaced, what is the immediate failure mode observed by users?
medium
Solution
Step 1: Understand cache failure impact
Without the cache, the API Gateway cannot track usage accurately, often defaulting to conservative rate limit errors to protect backend.Step 2: Evaluate other options
Silent drops cause user confusion; bypassing limits risks overload; automatic fallback to DB rate limiting is rare and slow.Final Answer:
Option A -> Option AQuick Check:
Cache failure -> conservative rate limit errors -> user impact [check]
Hint: Cache failure triggers conservative rate limit errors [check]
Common Mistakes:
