Practice
Solution
Step 1: Understand client-centric guarantees
Read-your-writes consistency ensures that a client always sees its own writes, even if it switches servers, without requiring global synchronization.Step 2: Eliminate other models
Strong consistency enforces global order but is costly and not required here; eventual consistency does not guarantee immediate visibility of own writes; causal consistency orders related operations but does not guarantee read-your-writes for a single client.Final Answer:
Option A -> Option AQuick Check:
Read-your-writes consistency ensures client sees own writes immediately [check]
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: Trace cache behavior on miss at step 4
On a cache miss, the cache should fetch fresh data from the backend to serve the request.Step 2: Confirm cache updates itself before responding
This ensures subsequent requests hit the cache, reducing latency and load on backend.Final Answer:
Option D -> Option DQuick Check:
Cache miss triggers backend fetch and cache update [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: Identify lock service role in reservation flow
The lock service ensures exclusive access to room inventory during reservation to prevent double booking.Step 2: Trace failure impact
Without the lock service, Inventory cannot reliably mark rooms as unavailable, leading to stale or incorrect availability states shown to users (Inventory service marks rooms as available incorrectly, causing UI to show wrong availability). Reservations may still proceed but with inconsistent inventory state. Blocking indefinitely (Reservation requests block indefinitely waiting for locks, causing user timeouts and failed bookings) is unlikely as fallback mechanisms exist. Payment processing (Payment processing fails because it depends on the lock service for transaction ordering) is independent of locking. Double bookings (Reservations proceed normally but double bookings increase due to lack of coordination) may increase but the immediate failure is incorrect inventory state.Final Answer:
Option C -> Option CQuick Check:
Lock service failure causes stale inventory availability state [check]
