Practice
Solution
Step 1: Identify the need for decoupling high write throughput
Immediate synchronous writes (Use a relational database with immediate synchronous writes for all connection requests and D) block user actions and don't scale well at 1M writes/sec. Redis (Use an in-memory cache like Redis to store connection requests temporarily without persistence) lacks durability and persistence guarantees for critical connection data.Step 2: Evaluate Kafka's role
Kafka buffers high write volume asynchronously, ensuring durability and eventual consistency without blocking user requests.Final Answer:
Option A -> Option AQuick Check:
Kafka buffers writes asynchronously -> decouples load [check]
Solution
Step 1: Understand Weighted Round Robin operation
Weighted Round Robin cycles through servers, selecting each server multiple times proportional to its weight before moving to the next.Step 2: Apply weights to selection
Server A with weight 5 will be selected more frequently than B or C. At step 5, the balancer continues cycling respecting weights.Final Answer:
Option A -> Option AQuick Check:
Weighted Round Robin respects weights in cycling, not just highest weight always [check]
Solution
Step 1: Evaluate shared thread pool risks
A single shared pool (A) risks cascading failures; circuit breakers (C) detect failures but don't isolate resource exhaustion. Autoscaling (D) reacts late and may not prevent blast radius.Step 2: Assess bulkhead benefits
Bulkheads (B) isolate failures per payment type, preventing one type's overload from affecting others, balancing isolation and utilization.Final Answer:
Option A -> Option AQuick Check:
Bulkheads isolate failures per resource partition [check]
Solution
Step 1: Identify real-time aggregation needs
Millions of listings require low-latency updates; immediate consistency is not mandatory.Step 2: Evaluate architectures
Relational DB (A) is costly and slow at scale; batch jobs (C) have high latency; NoSQL denormalization (D) risks write amplification and stale data. Stream processing (B) provides scalable, low-latency aggregation with eventual consistency.Final Answer:
Option A -> Option AQuick Check:
Stream processing enables scalable real-time aggregation with eventual consistency [check]
Solution
Step 1: Identify scaling bottlenecks
Central metadata service (The central shard metadata service, due to increased coordination overhead) may be distributed or avoided; shards (The individual database shards, because storage capacity limits are reached first) scale horizontally; client caches (The client-side routing cache, as it cannot handle the increased number of shards efficiently) can be sharded or refreshed incrementally.Step 2: Analyze hash ring management at scale
Hash ring management (The hash ring management service, because updating and propagating ring changes becomes a bottleneck) requires updating and propagating ring changes to all nodes; at 10x scale, this coordination overhead and update frequency cause it to become the first bottleneck.Final Answer:
Option C -> Option CQuick Check:
Hash ring updates bottleneck first at large scale [check]
