Practice
Solution
Step 1: Identify the bottleneck as CPU and memory on a single DB server
Vertical scaling adds resources to the existing server to handle more load without architectural changes.Step 2: Evaluate horizontal scaling and other options
Horizontal scaling requires application changes for sharding; caching reduces reads but not CPU-bound writes; switching DB types is a different trade-off.Final Answer:
Option B -> Option BQuick Check:
Vertical scaling adds resources to one server without code changes [check]
Solution
Step 1: Evaluate architectures for latency and availability
Monolithic (A) and single server batch reload (C) block requests during reload, increasing latency. Client-side loading (D) adds complexity and inconsistent versions.Step 2: Understand blue-green deployment benefits
Blue-green (B) runs two clusters; new model loads on inactive cluster, then traffic switches atomically, ensuring zero downtime and minimal latency impact.Final Answer:
Option C -> Option CQuick Check:
Blue-green enables atomic switch with zero downtime [check]
Solution
Step 1: Compare update and query costs
Quadtree (Use a Quadtree because it supports fast insertions and deletions with balanced trees) can become unbalanced and expensive to update frequently. R-tree (Use a full R-tree index because it guarantees minimal overlap and tight bounding rectangles) is complex and costly to maintain with frequent writes.Step 2: Evaluate Geohash benefits
Geohash (Use Geohash-based indexing because it supports efficient prefix queries and simpler updates) encodes locations into fixed-length strings allowing efficient prefix queries and simpler incremental updates, ideal for low-latency and frequent writes.Final Answer:
Option A -> Option AQuick Check:
Geohash supports efficient prefix queries and simpler updates [check]
Solution
Step 1: Understand health monitor role
The health monitor informs GSLB which data centers are healthy; without it, GSLB cannot avoid unhealthy endpoints.Step 2: Analyze failure impact
Without health info, GSLB routes users to unhealthy data centers causing failures (Users are routed to unhealthy data centers causing request failures or timeouts). Increased latency (Users experience increased latency due to rerouting through backup data centers) or DNS failures (DNS queries fail to resolve, causing complete service outage) are indirect or unlikely. Even traffic distribution (Traffic is evenly distributed regardless of data center health, causing overload) ignores health but is less precise than routing to unhealthy nodes.Final Answer:
Option A -> Option AQuick Check:
Silent health monitor failure -> routing to unhealthy data centers [check]
Solution
Step 1: Understand Kafka's role in decoupling and durability
Kafka buffers messages asynchronously, preventing blocking and enabling retries.Step 2: Trace failure without Kafka
Without Kafka, Alice's server must synchronously contact Bob's server. If Bob's server is slow or crashes, Alice's send blocks or message is lost with no retry.Final Answer:
Option B -> Option BQuick Check:
Without Kafka, synchronous send blocks and loses messages on Bob's server crash [check]
