Practice
Solution
Step 1: Identify communication direction and latency needs
Interactive gaming requires low latency and bidirectional communication, which Server-Sent Events and Long Polling do not efficiently provide.Step 2: Evaluate protocol capabilities
WebSockets provide full-duplex communication with minimal overhead, ideal for real-time interactive applications. HTTP/2 multiplexing is not widely supported for bidirectional streaming in browsers and adds complexity.Final Answer:
Option A -> Option AQuick Check:
WebSockets enable low-latency bidirectional streams [check]
Solution
Step 1: Understand adaptive bitrate streaming principles
Client-driven switching with multiple bitrate streams allows clients to adapt quickly to network changes, reducing buffering and wasted bandwidth.Step 2: Evaluate other options
Single high-bitrate wastes bandwidth; server-driven adaptation adds latency and complexity; fixed bitrate can't adapt to network variability.Final Answer:
Option C -> Option CQuick Check:
Client-driven multi-bitrate switching optimizes latency and bandwidth [check]
Solution
Step 1: Role of relationship index
The index enables efficient lookup of edges; without it, traversal cannot proceed correctly.Step 2: Behavior without index
Queries relying on the index return empty results silently because no edges are found, not errors or scans.Final Answer:
Option A -> Option AQuick Check:
Missing index causes silent empty results, not crashes or scans [check]
Solution
Step 1: Evaluate centralized Redis token bucket
Strong consistency causes high latency and bottlenecks under burst traffic.Step 2: Evaluate local token buckets with periodic sync
Allows burst handling locally with eventual consistency, reducing latency and bottlenecks.Step 3: Eliminate fixed window and leaky bucket options
Fixed window counters cause burst spikes; leaky bucket disallows bursts and lacks sync.Final Answer:
Option A -> Option AQuick Check:
Local token buckets + eventual sync balance burst and consistency [check]
Solution
Step 1: Evaluate DNS round-robin limitations
DNS round-robin (Use DNS round-robin to distribute requests evenly across data centers) lacks real-time health checks and can send traffic to unhealthy data centers, causing poor availability.Step 2: Assess global load balancer benefits
A global load balancer (Use a global load balancer with health checks and geo-routing capabilities) performs health checks and routes users to the nearest healthy data center, optimizing latency and availability.Step 3: Consider client-side and centralized load balancing drawbacks
Client-side load balancing (Use client-side load balancing with hardcoded server IPs in the client app) is hard to update and lacks global awareness. A single centralized load balancer (Use a single centralized load balancer in one data center to route all traffic) creates a single point of failure and latency bottleneck.Final Answer:
Option B -> Option BQuick Check:
Global load balancer with geo-routing optimizes latency and availability [check]
