Practice
Solution
Step 1: Identify low-latency retrieval need
Relational DBs (A) have high query latency for vector similarity; distributed file systems (C) are for storage, not fast retrieval; message queues (D) buffer requests but don't serve retrieval.Step 2: Recognize vector search role
ANN-based in-memory vector search engines (B) provide fast approximate nearest neighbor lookups, ideal for sub-100ms latency code snippet retrieval.Final Answer:
Option B -> Option BQuick Check:
ANN vector search enables fast similarity queries [check]
Solution
Step 1: Consider mobile client and caching constraints
Mobile clients and caching proxies often ignore or strip custom headers, making header-based versioning unreliable.Step 2: Evaluate URL versioning benefits
Embedding version in URL ensures cache keys differ per version, enabling backward compatibility and cache friendliness.Final Answer:
Option A -> Option AQuick Check:
URL versioning works best with caching proxies and limited header control [check]
Solution
Step 1: Role of message queue in gRPC server
The queue buffers messages for slow or disconnected clients, enabling retries and flow control.Step 2: Effect of removing the queue
Without the queue, messages sent to slow/disconnected clients are dropped immediately, causing message loss without retries.Final Answer:
Option C -> Option CQuick Check:
No queue -> message loss on slow/disconnected clients [check]
Solution
Step 1: Evaluate Redis SETNX under high contention
Redis SETNX with TTL (A) is fast but can cause split-brain and stale locks under network partitions, violating correctness.Step 2: Consider consensus-based lock service
Consensus-based services like etcd (B) provide strong consistency and fault tolerance, ensuring correctness even if latency is higher.Step 3: Assess database row locks and local locks
Database locks (C) have high latency and risk deadlocks; local locks (D) do not coordinate across nodes, failing correctness.Final Answer:
Option B -> Option BQuick Check:
Consensus ensures correctness under contention despite latency [check]
Solution
Step 1: Identify scaling challenges of Global Traffic Manager
It maintains real-time health and routing state for all CDNs and users, which grows with traffic scale.Step 2: Compare other components
Origin servers (A) can be scaled horizontally with caching. Edge caches (C) scale by adding nodes. Client DNS (D) caching delays but does not bottleneck traffic flow.Step 3: Conclude bottleneck
Global Traffic Manager's centralized stateful routing logic is hardest to shard and scale linearly.Final Answer:
Option D -> Option DQuick Check:
Global Traffic Manager stateful routing -> first bottleneck at 10x scale [check]
