Practice
Solution
Step 1: Identify rate limiting responsibility
The API Gateway is the entry point and can efficiently enforce rate limits before requests reach backend services, preventing overload.Step 2: Eliminate other options
The backend microservices implement rate limiting individually to distribute load spreads rate limiting, risking inconsistent enforcement and backend overload. A centralized database tracks request counts and enforces limits synchronously adds latency and complexity by synchronous DB checks. Clients are responsible for self-throttling their request rates trusts clients, which is insecure.Final Answer:
Option A -> Option AQuick Check:
API Gateway enforces rate limits upfront to protect backend [check]
Solution
Step 1: Trace Delivery Worker decision at Step 4 -- Bob's presence TTL
If Bob's presence TTL expired, Delivery Worker treats Bob as offline and queues message for offline storage.Step 2: Eliminate other options
Marking delivered without sending is incorrect; retrying indefinitely blocks delivery; sending regardless ignores offline status.Final Answer:
Option A -> Option AQuick Check:
Expired presence TTL -> queue for offline delivery [check]
Solution
Step 1: Understand durability impact on vector storage
Without persistence, recent inserts are lost on crash, but existing index data remains intact.Step 2: Analyze index rebuild behavior
HNSW index rebuilds from last persisted snapshot, so it uses stale data but does not corrupt links.Final Answer:
Option A -> Option AQuick Check:
Index rebuild uses stale data; recent inserts lost but no corruption [check]
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]
Solution
Step 1: Identify stateful bottleneck
Chat servers maintain WebSocket connections bound to server memory, limiting horizontal scaling and resharding.Step 2: Compare other components
Database (A) can be scaled with sharding; message queue (C) partitions can be increased; load balancer (D) scales horizontally.Step 3: Explain failure mechanism
WebSocket statefulness causes connection limits per server, leading to failure under 10x load.Final Answer:
Option A -> Option AQuick Check:
Stateful WebSocket limits -> chat servers fail first at scale [check]
