Practice
1. In a system using asynchronous replication, at step 4 the Replication Worker reads the write-ahead log entry for a committed transaction. What is the state of the replica after this step if the worker crashes before applying the entry?
easy
Solution
Step 1: Trace Replication Worker reading WAL entry
Worker reads the log but crashes before applying, so replica state unchanged.Step 2: Understand retry behavior on restart
Since transaction not applied, worker retries applying on restart ensuring consistency.Final Answer:
Option B -> Option BQuick Check:
Unapplied transaction retried after crash [check]
Hint: Unapplied logs retried after crash, no partial state [check]
Common Mistakes:
2. In the TLS handshake trace, at step 4 the server sends its certificate chain to the client. What does the client do immediately after receiving this chain at step 5?
easy
Solution
Step 1: Understand client certificate validation
After receiving the server's certificate chain, the client validates it against its trusted root certificate authorities to ensure authenticity.Step 2: Eliminate incorrect options
The client immediately sends encrypted application data without verification is wrong because the client must verify before sending encrypted data. The client requests a new certificate from the server is incorrect; clients do not request certificates from servers. The client closes the connection if the certificate is expired without any retries is partially true but the client may attempt other steps like checking revocation before closing.Final Answer:
Option D -> Option DQuick Check:
Client verifies certificate chain before proceeding [check]
Hint: Client verifies certificate chain before encrypted data [check]
Common Mistakes:
3. A distributed system requires a lock mechanism that ensures mutual exclusion across multiple Redis instances with minimal risk of deadlocks. Which component or approach best handles this requirement?
easy
Solution
Step 1: Understand distributed lock requirements
Single Redis instance with SETNX risks single point of failure and split-brain issues.Step 2: Evaluate Redlock's multi-instance coordination
Redlock uses multiple Redis masters to reduce risk of deadlocks and ensure safety under partial failures.Final Answer:
Option A -> Option AQuick Check:
Redlock coordinates multiple Redis masters for safer distributed locks [check]
Hint: Multiple Redis masters coordinated -> safer distributed locks [check]
Common Mistakes:
4. A web application experiences increasing CPU load on a single database server, causing query latency spikes. Which scaling approach best addresses this bottleneck without changing the application code?
easy
Solution
Step 1: Identify the bottleneck as CPU and memory on a single DB server
Vertical scaling adds resources to the existing server to handle more load without architectural changes.Step 2: Evaluate horizontal scaling and other options
Horizontal scaling requires application changes for sharding; caching reduces reads but not CPU-bound writes; switching DB types is a different trade-off.Final Answer:
Option B -> Option BQuick Check:
Vertical scaling adds resources to one server without code changes [check]
Hint: Vertical scaling adds power to one machine [check]
Common Mistakes:
5. If the Booking Service loses connectivity to the Calendar Availability Service during booking confirmation, what is the most likely failure mode experienced by the user?
medium
Solution
Step 1: Trace failure impact on booking flow
Loss of connectivity prevents immediate calendar update, risking inconsistency.Step 2: Analyze failure handling
Immediate confirmation without calendar update (A) risks double bookings; timeout with error (B) hurts UX; automatic retry without delay (D) is unrealistic under network failure. Local queuing (C) allows eventual consistency with delayed confirmation.Final Answer:
Option A -> Option AQuick Check:
Local queuing delays confirmation but prevents data loss [check]
Hint: Booking queues locally on calendar service failure, delaying confirmation [check]
Common Mistakes:
