Practice
Solution
Step 1: Identify indexing method for high-dimensional vectors
Relational DBs with B-tree indexes (A relational database with B-tree indexes) are inefficient for high-dimensional ANN queries due to curse of dimensionality.Step 2: Evaluate ANN-specific indexes
HNSW (An HNSW (Hierarchical Navigable Small World) graph index) is designed for fast approximate nearest neighbor search with logarithmic query time and high recall.Final Answer:
Option C -> Option CQuick Check:
HNSW graph index enables efficient ANN search in high dimensions [check]
Solution
Step 1: Understand migration triggers
Data Migration Worker uses access frequency to decide tier movement; low frequency triggers move to colder tier.Step 2: Identify correct tier movement
Data with low access frequency moves from warm to cold storage, not deletion or promotion.Final Answer:
Option C -> Option CQuick Check:
Low access frequency -> warm to cold migration [check]
Solution
Step 1: Analyze latency and accuracy trade-offs
Synchronous updates (Synchronous billing updates on every tenant API call to the billing database) add latency; polling (Periodic polling of tenant usage logs by the billing service every hour) delays billing data; in-memory counters (Embedding billing logic directly in the tenant service to update counters in-memory) risk data loss.Step 2: Evaluate asynchronous event-driven approach
Asynchronous event-driven usage aggregation via a message queue and batch processing decouples billing from tenant requests, ensuring accurate aggregation with minimal latency impact.Final Answer:
Option A -> Option AQuick Check:
Event-driven async billing -> accurate, low-latency tenant requests [check]
Solution
Step 1: Identify Raft leader responsibilities
The leader serializes all client writes and replicates logs to followers, causing CPU and network load concentration.Step 2: Analyze scaling impact
At 10x scale, leader's CPU and network become bottlenecks before followers or network saturate.Final Answer:
Option D -> Option DQuick Check:
Leader handles all writes and replication -> first bottleneck at scale [check]
Solution
Step 1: Identify bottlenecks at 10x scale
Distributed lock service coordinates exclusive access and must handle many concurrent lock requests.Step 2: Evaluate component scalability
Relational DB (The relational database because it cannot handle the increased write throughput for reservations) can be scaled with sharding and read replicas. Inventory Service caches (The Inventory Service because it maintains stateful caches that cannot be sharded easily) can be sharded or invalidated. API Gateway (The API Gateway because it cannot route the increased number of client requests efficiently) can be horizontally scaled with load balancers. The lock service (The distributed lock service because it becomes a bottleneck coordinating locks across many nodes) is a centralized coordination point and becomes a bottleneck due to synchronization overhead and network latency.Final Answer:
Option A -> Option AQuick Check:
Distributed lock service bottlenecks first due to coordination overhead [check]
