Practice
1. A distributed cache system must evenly distribute keys across nodes and gracefully handle node failures without massive key remapping. Which component or technique best addresses this requirement?
easy
Solution
Step 1: Understand key distribution needs
Simple modulo hashing (Using a simple modulo hash function on node count to assign keys) causes massive remapping when nodes change, failing graceful scaling.Step 2: Evaluate consistent hashing benefits
Consistent hashing with virtual nodes (Implementing consistent hashing with virtual nodes) minimizes remapping and balances load even with node failures.Final Answer:
Option A -> Option AQuick Check:
Consistent hashing with virtual nodes -> minimal key remapping on node changes [check]
Hint: Consistent hashing + virtual nodes minimize remap on node changes [OK]
Common Mistakes:
2. If the database system loses the statistics metadata used by the query optimizer for index selectivity, what is the most likely failure mode during query execution?
medium
Solution
Step 1: Role of statistics metadata
Statistics guide the optimizer to estimate index selectivity and cost, influencing index usage decisions.Step 2: Effect of lost statistics
Without statistics, the optimizer cannot accurately estimate costs and may default to safer full table scans, degrading performance but not correctness.Final Answer:
Option D -> Option DQuick Check:
Missing stats cause poor plan choice, not query failure [check]
Hint: No stats -> optimizer picks full scan, slower but correct [check]
Common Mistakes:
3. If the Signaling Server crashes after forwarding Alice's SDP offer but before receiving Bob's answer, what is the most likely failure observed by Alice?
medium
Solution
Step 1: Trace failure impact of Signaling Server crash after forwarding offer
If the server crashes before recording the offer state, it may resend the offer when restarted, causing duplicates.Step 2: Analyze other options
No immediate error (A) is unlikely; indefinite ringing (B) happens if answer lost but not duplicated; media server (D) does not start without signaling.Final Answer:
Option D -> Option DQuick Check:
Signaling crash causes duplicate offers, confusing Bob's client [check]
Hint: Signaling crash -> duplicate offers, not silent failure [check]
Common Mistakes:
4. If the client fails to validate the server's certificate chain during the TLS handshake, what is the most likely failure observed in the connection?
medium
Solution
Step 1: Understand client certificate validation failure
If the client detects an invalid certificate chain, it aborts the handshake and terminates the connection to prevent insecure communication.Step 2: Analyze options
The client proceeds with encrypted communication but logs a warning is incorrect because clients do not proceed with encryption if validation fails. The server retries sending the certificate chain automatically is incorrect; servers do not retry sending certificates automatically. The client falls back to unencrypted HTTP automatically is incorrect because clients do not downgrade to HTTP automatically.Final Answer:
Option C -> Option CQuick Check:
Client aborts handshake on certificate validation failure [check]
Hint: Certificate validation failure -> handshake abort, no fallback [check]
Common Mistakes:
5. For a distributed key-value store requiring minimal key remapping and simple node addition/removal, which approach is best and why?
medium
Solution
Step 1: Compare remapping and node management
Modulo hashing (Use modulo hashing with a centralized directory for simplicity) causes massive remapping on node changes. Random assignment (Use random node assignment with periodic rebalancing) causes uneven load and complex rebalancing. Consistent hashing with virtual nodes (Use consistent hashing with virtual nodes to balance load evenly) balances load but requires ring maintenance.Step 2: Identify Rendezvous Hashing advantages
Rendezvous Hashing minimizes remapping and avoids ring maintenance, simplifying node addition/removal.Final Answer:
Option C -> Option CQuick Check:
Minimal remapping + no ring maintenance -> Rendezvous Hashing [check]
Hint: Minimal remap, no ring -> Rendezvous Hashing [check]
Common Mistakes:
