Replication, consistency, and recovery
Original distributed systems interview scenarios on observable guarantees, replication, retries, ownership, recovery, and diagnosing failures from evidence.
These prompts are original practice. They are not questions from a named employer or a live hiring loop.
1.A catalog promises linearizable reads of each item. A price update completes before another client starts reading that item. Which result is permitted, assuming no later write?
Show answer and explanation
- The updated price
- A random price from the last hour
- The previous price from any replica
- Either price until a scheduled repair
Answer: The updated price
Linearizability respects completed operations in real time. Without a later write, a subsequent read cannot return the older item value.
2.Two clients concurrently replace the same linearizable register. Neither finishes before the other starts. What must the implementation provide?
Show answer and explanation
- Both values must remain independently current
- Every replica must receive both requests together
- The client with the earlier wall clock must win
- One ordering consistent with both responses
Answer: One ordering consistent with both responses
Overlapping operations may be ordered either way, but the observed responses must fit a legal single-register history.
3.A user edits a profile through the primary and immediately reads from a lagging replica. Which design supports read-your-writes without sending every read to the primary?
Show answer and explanation
- Randomly choose a different replica
- Shorten the browser's cache lifetime
- Wait until the replica reaches the session's write position
- Return the replica result with a fresh timestamp
Answer: Wait until the replica reaches the session's write position
A session can carry a minimum observed log position. The serving replica must reach it or route the request to a suitable node.
4.A store guarantees linearizable operations separately on each key. An engineer claims that reading two keys automatically gives an atomic snapshot. What is missing?
Show answer and explanation
- A larger checksum for each key
- A guarantee spanning the two-key read
- An additional replica in another rack
- An increasing timestamp on the response
Answer: A guarantee spanning the two-key read
Per-key ordering does not by itself coordinate a multi-key snapshot. The application needs an appropriate transaction or snapshot facility.
5.Two transactions each see one of two workers on duty, then independently mark their own worker off duty. Both commit under snapshot isolation. What prevents this invariant violation?
Show answer and explanation
- Increase the replica read timeout
- Serialize the shared duty constraint
- Compress the transaction log
- Add an index to each worker name
Answer: Serialize the shared duty constraint
The transactions modify different rows but jointly violate a constraint. Serializable enforcement or explicit coordination of that constraint is needed.
6.A crash-tolerant replicated log has seven voting members and requires a strict majority for commitment. How many votes are needed?
Show answer and explanation
- 5
- 7
- 3
- 4
Answer: 4
A strict majority is floor(7/2) + 1 = 4. Three members alone cannot form that quorum.
7.A fixed five-replica register uses reads from three replicas and writes to three replicas. What does quorum intersection establish by itself?
Show answer and explanation
- Every read set overlaps every write set
- Concurrent writes cannot occur
- Every replica has the latest value
- Every read is automatically linearizable
Answer: Every read set overlaps every write set
Since 3 + 3 exceeds 5, the sets overlap. Version rules, concurrent operations, and the read protocol still determine consistency.
8.A team wants to replace all voters at once, allowing either old or new majorities to approve writes during transition. What is the central risk?
Show answer and explanation
- The new group must have fewer members
- The two deciding groups may be disjoint
- Read latency must exceed write latency
- The log will necessarily become compressed
Answer: The two deciding groups may be disjoint
Disjoint decision groups can accept incompatible histories. Membership changes need a protocol that preserves the required quorum relationships.
9.A log replica acknowledges a write after copying it into a volatile buffer. What does that acknowledgment fail to demonstrate?
Show answer and explanation
- That the replica allocated some memory
- That the request reached the replica
- That the request had a valid network checksum
- That the write survives its process or machine crash
Answer: That the write survives its process or machine crash
Receiving bytes in memory is not durable storage. An acknowledgment must match the advertised persistence boundary.
10.A consensus voter forgets its recorded vote when it restarts during the same election term. What safety concern follows?
Show answer and explanation
- Its disk checksum changes the quorum size
- It could vote for a second candidate in that term
- It must reject all future log entries
- Its network address becomes invalid
Answer: It could vote for a second candidate in that term
If the protocol relies on one vote per voter per term, that voting state must survive a crash before the voter acknowledges it.
11.An old storage worker resumes after losing ownership. The new worker already has a higher fencing token. Where must the old worker's write be rejected?
Show answer and explanation
- At a client that has already disconnected
- Only in the new worker's local memory
- At the resource that applies the write
- Only in the ownership dashboard
Answer: At the resource that applies the write
Ownership checks in a coordinator do not stop a paused worker's later side effect. The protected resource must enforce fencing order.
12.A service uses time-limited leases to prevent concurrent writers. Which assumption must its safety argument address?
Show answer and explanation
- Whether all nodes report healthy at lease creation
- Clock behavior and the timing bounds of lease use
- Whether every request has a unique identifier
- Whether the replicas have equal disk capacity
Answer: Clock behavior and the timing bounds of lease use
Lease safety depends on explicit clock and timing assumptions. Unbounded pauses or clock error cannot be dismissed as mere monitoring issues.
13.A request has a local 200 ms execution budget. Which clock is appropriate for measuring elapsed time inside the process?
Show answer and explanation
- A monotonic clock
- The timestamp of the latest backup
- The client's calendar timestamp
- A manually adjusted wall clock
Answer: A monotonic clock
A monotonic clock measures elapsed duration without wall-clock corrections moving the apparent deadline backward or forward.
14.A replica does not answer within 80 ms. What can the caller conclude solely from that timeout?
Show answer and explanation
- The caller did not receive an answer in time
- The replica discarded the request
- The request's side effect did not occur
- The replica has permanently crashed
Answer: The caller did not receive an answer in time
A timeout does not distinguish slow processing, message loss, a lost reply, or a failed node. The operation may already have taken effect.
15.An inventory reservation times out after the server commits it. What client behavior avoids creating a second reservation on retry?
Show answer and explanation
- Change the item count on each retry
- Generate a new reservation identifier
- Retry against every replica independently
- Reuse the same operation identifier
Answer: Reuse the same operation identifier
A stable operation identity lets the service recognize a repeated request and return its prior result rather than apply another reservation.
16.A payment simulator writes its result and deduplication record in separate transactions. A crash can occur between them. What closes the duplicate-effect gap?
Show answer and explanation
- Commit both records atomically
- Keep the deduplication record in a client cache
- Increase the response body size
- Retry only during quiet periods
Answer: Commit both records atomically
The effect and evidence that it happened must share an atomic boundary, or recovery can reapply a committed effect lacking its deduplication record.
17.Two requests use the same idempotency key but specify different delivery addresses. What should the service do?
Show answer and explanation
- Apply both requests in arrival order
- Reject the conflicting reuse
- Choose the shorter address
- Silently return the second address
Answer: Reject the conflicting reuse
Bind a key to the original request meaning. Conflicting payloads must not silently become one operation or apply an unintended update.
18.A service keeps idempotency records for one day, while clients may retry requests for three days. What must be resolved?
Show answer and explanation
- The service needs a shorter network timeout
- The retry horizon exceeds duplicate protection
- The response should contain fewer fields
- The request identifier has too many characters
Answer: The retry horizon exceeds duplicate protection
A late retry after record expiry can look new. Align retention and retry contracts or use another durable mechanism for recognizing old operations.
19.An order database commits an order, but the process crashes before publishing its notification event. Which pattern records publishable work within the order transaction?
Show answer and explanation
- A transactional outbox
- A larger message timeout
- A second independent write after commit
- An in-memory timer
Answer: A transactional outbox
The outbox stores the event alongside the business change. A separate publisher can retry delivery without losing the committed notification intent.
20.A consumer updates a local balance and then stores its processed-event marker separately. How can it prevent redelivery from changing the balance twice?
Show answer and explanation
- Acknowledge before opening the database
- Delete the event before changing the balance
- Commit the balance change and marker together
- Track only the consumer's process uptime
Answer: Commit the balance change and marker together
Atomic effect and deduplication state let redelivery be recognized. A crash between separate writes otherwise leaves an ambiguous result.
21.A worker sends a notification through an external service, then crashes before recording success. Why is a local transaction alone insufficient?
Show answer and explanation
- It requires the message body to be binary
- It cannot survive any process restart
- It cannot store a notification identifier
- It cannot atomically include the external send
Answer: It cannot atomically include the external send
The external service is outside the local atomic boundary. Use its idempotency support, a reconciliation protocol, or an explicitly weaker delivery contract.
22.A stream preserves order within each partition. Two changes to one account are sent to different partitions. What has the producer failed to preserve?
Show answer and explanation
- The total number of available consumers
- The checksums of unrelated accounts
- The maximum payload size
- The account's required ordering domain
Answer: The account's required ordering domain
If related changes require ordered handling, their routing and sequence rules must keep them within a suitable ordering domain or explicitly coordinate them.
23.A projector receives account event 18 after event 16, and the contract requires every transition. What should it do before advancing the account projection?
Show answer and explanation
- Resolve or buffer the missing event 17
- Assume event 17 contained no change
- Discard the account's entire history
- Rename event 18 to event 17
Answer: Resolve or buffer the missing event 17
A sequence gap indicates missing evidence, not an empty operation. Recovery must preserve the projection's ordering and completeness requirements.
24.One malformed event repeatedly crashes a partition consumer. Which response protects progress while preserving evidence?
Show answer and explanation
- Quarantine it through an explicit recovery policy
- Delete every event in the partition
- Commit all later events as successfully processed
- Increase retries without any limit
Answer: Quarantine it through an explicit recovery policy
Quarantine and alerting preserve the failed item for investigation. The ordering contract determines whether and how later work may proceed.
25.A dead-letter event is repaired and replayed after its original delivery may have partially succeeded. What property is still needed?
Show answer and explanation
- A different color in the monitoring chart
- A shorter event timestamp
- Duplicate-safe handling of its effects
- Removal of every prior audit record
Answer: Duplicate-safe handling of its effects
Replaying repaired data does not establish that earlier effects were absent. The replay path still needs deduplication, reconciliation, or compensating logic.
26.A consumer handles 700 events per second while producers sustain 1,100. What does an unbounded queue accomplish?
Show answer and explanation
- It guarantees no eventual overload
- It raises sustainable consumer capacity to 1,100
- It accumulates delay and resource usage
- It makes producer retries unnecessary
Answer: It accumulates delay and resource usage
The backlog grows by roughly 400 events per second while those rates persist. Backpressure, admission control, or capacity changes must address the imbalance.
27.A shard's working memory is exhausted by accepted requests waiting on disk. What control directly limits this pressure?
Show answer and explanation
- Bound admitted concurrent work
- Accept requests before checking capacity
- Increase every caller's retry count
- Raise the request body limit
Answer: Bound admitted concurrent work
Admission limits keep waiting work within resource budgets. More retries or larger requests can worsen an already saturated shard.
28.Thousands of clients retry exactly one second after a shared failure. What reduces synchronized recovery bursts?
Show answer and explanation
- Remove the maximum retry limit
- Randomize delay within the retry policy
- Give every client the same longer delay
- Restart all clients at the same instant
Answer: Randomize delay within the retry policy
Jitter spreads retries over time. Backoff and retry limits still need to respect the service's recovery capacity and the caller's deadline.
29.An incoming request has 120 ms remaining. Its downstream call is configured to wait 500 ms. What should the caller propagate?
Show answer and explanation
- The original request's creation date only
- The downstream service's longest observed duration
- A new unlimited execution budget
- A deadline bounded by the remaining budget
Answer: A deadline bounded by the remaining budget
Downstream work should fit the remaining useful lifetime of the request, including any budget needed to return or clean up.
30.A team duplicates slow reads to improve tail latency. Which condition is important before enabling hedging?
Show answer and explanation
- The overloaded dependency must receive all duplicates
- The operation performs an unguarded debit
- The first request must always be canceled before sending another
- The operation tolerates duplicates and spare capacity exists
Answer: The operation tolerates duplicates and spare capacity exists
Hedging can reduce slow-read latency but increases work. It is unsuitable for unprotected side effects and can amplify overload without limits.
31.A dependency has been blocked by an open circuit breaker. How should recovery be tested?
Show answer and explanation
- Permit a bounded number of trial requests
- Reset the failure counter before sending any probe
- Release the full backlog when one probe succeeds
- Keep using the most recent cached success status
Answer: Permit a bounded number of trial requests
Limited probes test current behavior without immediately recreating the original load spike. Recovery policy should consider both errors and capacity.
32.A slow export endpoint consumes all database connections and blocks interactive requests. Which isolation most directly contains the problem?
Show answer and explanation
- Let connection requests wait without a deadline
- Use one larger queue shared by both workloads
- Raise the export concurrency to drain it faster
- Separate bounded connection budgets by workload
Answer: Separate bounded connection budgets by workload
Resource isolation prevents one workload from consuming all capacity needed by another. The limits must still fit the database's total budget.
33.A service is overloaded and cannot complete all admitted work before deadlines. Which rejection strategy is most defensible?
Show answer and explanation
- Accept everything and let memory decide the outcome
- Disable request accounting until load falls
- Hide all failures behind successful status codes
- Reject low-priority work early with a clear retry contract
Answer: Reject low-priority work early with a clear retry contract
Early, intentional rejection protects useful capacity and makes caller behavior predictable. Silent success and uncontrolled queues hide loss rather than handle it.
34.A dependency's mean latency stays flat while its 99th percentile doubles. Which conclusion is justified?
Show answer and explanation
- All requests now take twice their earlier duration
- Slow requests worsened despite the stable mean
- The stable mean rules out a user-visible slowdown
- The percentile change identifies packet loss as the cause
Answer: Slow requests worsened despite the stable mean
An unchanged average can conceal a deteriorating tail. Inspect distributions, sample counts, and affected request paths before assigning a cause.
35.A request makes ten independent parallel calls. Each has a 0.98 probability of finishing within the deadline. What is the probability all ten finish in time?
Show answer and explanation
- Exactly 0.98
- Exactly 0.20
- About 0.817
- About 0.998
Answer: About 0.817
Under the stated independence assumption, multiply the probabilities: 0.98^10 is about 0.817. Shared failures would invalidate that simple model.
36.A stable service completes 240 jobs per second and averages 60 jobs waiting in its queue. What is the mean queue wait under Little's law?
Show answer and explanation
- 4 seconds
- 0.25 seconds
- 60 seconds
- 14,400 seconds
Answer: 0.25 seconds
For the queue alone, Lq = arrival rate × Wq. With stable throughput, Wq = 60/240 = 0.25 seconds; processing time is separate.
37.Two disconnected sites must both accept conflicting updates to the same single-valued register. What must a design that keeps serving both sides explain?
Show answer and explanation
- How TCP prevents all conflicting updates
- How it relaxes consistency and reconciles conflicts
- Why the last network packet is always authoritative
- Why two independent writers constitute one quorum
Answer: How it relaxes consistency and reconciles conflicts
Serving incompatible writes in both partitions cannot also preserve a linearizable single-register history. State the availability and reconciliation contract explicitly.
38.A replication algorithm assumes nodes can crash but never fabricate protocol messages. What changes if a node can lie about its stored log?
Show answer and explanation
- The failure model and safety argument must change
- Adding one cache automatically restores correctness
- A shorter election timeout proves safety
- The node becomes equivalent to a slow follower
Answer: The failure model and safety argument must change
Crash-fault reasoning does not cover arbitrary malicious or corrupted behavior. Detecting or tolerating such behavior needs additional assumptions and mechanisms.
39.A snapshot contains applied state through log position 900. Where should replay begin, assuming the snapshot is valid and position 900 is included?
Show answer and explanation
- At the newest entry regardless of gaps
- At the first required entry after 900
- At a position chosen from the file's modification time
- At 900 without any duplicate safeguards
Answer: At the first required entry after 900
The snapshot already represents its included prefix. Replay must continue from the next needed entry without skipping required transitions or double-applying them.
40.A backup copies related tables at different moments while writes continue. What property is missing for a coherent restore?
Show answer and explanation
- A consistent recovery point across the data
- Identical row counts in the copied tables
- The latest file modification time from any replica
- The same compression setting for every table
Answer: A consistent recovery point across the data
Files from unrelated moments can violate cross-table invariants. Use a coordinated snapshot or a documented log-based procedure that reconstructs a consistent state.
41.A database may flush a modified data page before the corresponding recovery log is durable. What recovery problem can result?
Show answer and explanation
- The log must become larger than the database
- The page's key automatically changes
- The page change lacks the log needed to explain it
- Every transaction becomes read-only
Answer: The page change lacks the log needed to explain it
Write-ahead ordering ensures recovery has the durable record needed before changed pages reach persistent storage. Reversing that order can undermine crash recovery.
42.A replica finds a checksum mismatch in a stored segment. What should the system avoid doing automatically?
Show answer and explanation
- Replicating the unverified bytes as authoritative
- Compare against independently verified healthy copies
- Record the segment and preserve the failed bytes
- Quarantine the segment pending a documented repair
Answer: Replicating the unverified bytes as authoritative
Replication can spread corruption if a damaged copy is treated as truth. Verify independent evidence before repairing or replacing healthy data.
43.A process crashes while replacing a metadata file. Readers may see half of the new file. What property should the replacement protocol provide?
Show answer and explanation
- A longer human-readable filename
- A larger process heap
- An atomic, recoverable switch between complete versions
- A different field order in the JSON
Answer: An atomic, recoverable switch between complete versions
Readers need a complete old or new version, with persistence steps matching the crash model. File naming or extra memory does not provide atomic replacement.
44.A benchmark calls a write complete when the operating system accepts its bytes. Production requires survival of machine power loss. What is wrong with the comparison?
Show answer and explanation
- The results differ only because production has more replicas
- The benchmark uses a weaker durability boundary
- The benchmark should use a larger request batch only
- Production should acknowledge before persistence to match it
Answer: The benchmark uses a weaker durability boundary
A buffered acknowledgment and a durable acknowledgment measure different contracts. Compare latency only after aligning persistence and failure assumptions.
45.Three replicas sit on different virtual machines backed by one physical storage failure domain. What weakness remains?
Show answer and explanation
- One shared failure can affect all copies
- A majority necessarily requires four votes
- Virtual machines cannot retain any state
- The replicas cannot exchange messages
Answer: One shared failure can affect all copies
Replica count alone does not establish independent protection. Map shared power, storage, network, and administrative failure domains.
46.A remote asynchronous replica is 35 seconds behind when the primary site is lost. What does its recovery point imply?
Show answer and explanation
- No acknowledged change can be lost
- Recovery must finish in exactly 35 seconds
- Every older backup is unusable
- Up to that lag's committed changes may be missing
Answer: Up to that lag's committed changes may be missing
Replication lag bounds the exposed recent history only under the stated observations. It describes potential data loss, not the duration of service recovery.
47.A system restores 600 GB at a sustained 100 MB/s, using decimal units. What is the transfer time before validation and restart work?
Show answer and explanation
- 60,000 seconds
- 60 seconds
- 600 seconds
- 6,000 seconds
Answer: 6,000 seconds
600 GB is 600,000 MB. Dividing by 100 MB/s gives 6,000 seconds, about 100 minutes, excluding other recovery steps.
48.A restored coordinator starts with ownership counters older than those used by surviving workers. What must recovery establish?
Show answer and explanation
- Restart workers using their previous ownership tokens
- Restore counters exactly and assume surviving workers notice
- Allow the old and restored coordinators to issue equal tokens
- An ownership epoch that cannot revive stale authority
Answer: An ownership epoch that cannot revive stale authority
Restoring data must not make old authority valid again. Coordinate fencing epochs and external state before allowing restored workers to act.
49.A restored backup contains accounts deleted after the backup was taken. What additional recovery input may be required?
Show answer and explanation
- Authoritative deletion records since the backup point
- The restored database file modification times
- The backup manifest without subsequent change history
- The most recent account count from a monitoring chart
Answer: Authoritative deletion records since the backup point
Recovery must respect later deletions and retention obligations. Replaying data without the relevant deletion history can resurrect records incorrectly.
50.A partition map adds one equal-capacity node to a consistent-hash ring. What is its main placement benefit compared with remapping every key?
Show answer and explanation
- No key ever changes owner
- Only a subset of key ownership normally moves
- Hot keys automatically stop being hot
- Every node stores an identical full copy
Answer: Only a subset of key ownership normally moves
Consistent hashing reduces remapping on membership changes. It does not eliminate movement, replication design, capacity imbalance, or hot-key concentration.
51.A single popular document dominates one shard's traffic while other shards are idle. Why might adding ordinary hash shards not help?
Show answer and explanation
- The same key still maps to one ownership unit
- Hashing distributes each read across all shards
- The document's value must become smaller
- The routing table cannot contain more nodes
Answer: The same key still maps to one ownership unit
Hash partitioning spreads different keys, not necessarily one key's work. Caching, replication, batching, or an application-specific split may be needed.
52.A key range moves while clients continue writing. What does the handoff protocol need to establish?
Show answer and explanation
- Which owner may accept each write during transition
- That every request uses a new random key
- That both owners may independently acknowledge all writes
- That the old owner's audit log is removed first
Answer: Which owner may accept each write during transition
Migration must preserve a clear write authority or coordinated forwarding rule. Otherwise acknowledged writes can split across incompatible owners.
53.A client sends a write using an obsolete shard map. What response best supports safe routing?
Show answer and explanation
- Assume the old map remains authoritative forever
- Apply the write to an unrelated local shard
- Reject or redirect with a newer routing epoch
- Change the operation identifier before retrying
Answer: Reject or redirect with a newer routing epoch
Versioned routing lets servers detect stale placement knowledge. Retries must preserve operation identity and respect the current ownership rules.
54.A migration independently writes each update to old and new databases. One write can succeed while the other fails. What remains necessary?
Show answer and explanation
- An equal timeout for the two independent writes
- Routing both writes through the same client process
- A durable method to detect and reconcile divergence
- Matching row counts at the start of the migration
Answer: A durable method to detect and reconcile divergence
Independent dual writes are not atomic. An authoritative change log, outbox, or equivalent recovery process must account for partial success.
55.A deleted key is absent on one replica but still present on an offline replica. Why retain a deletion tombstone?
Show answer and explanation
- To make every replica immediately reachable
- To distinguish deletion from missing replication state
- To prevent any future key with that spelling
- To increase the deleted value's retention forever
Answer: To distinguish deletion from missing replication state
A deletion marker carries versioned evidence that older values should not reappear. Its lifecycle must match repair and replica recovery assumptions.
56.A team discards deletion markers before a long-offline replica rejoins. What failure should it test?
Show answer and explanation
- Network packets losing their checksums
- Old values returning during reconciliation
- The quorum size increasing by one
- Every new value becoming encrypted twice
Answer: Old values returning during reconciliation
If returning replicas can present versions older than forgotten deletions, repair may resurrect data. Retirement needs a safe recovery or rejoin policy.
57.A read detects an older replica and asynchronously schedules repair. What should a client not infer merely from that scheduling?
Show answer and explanation
- That the inconsistency was observed
- That another replica held a newer version
- That every future replica read is already current
- That a repair task was requested
Answer: That every future replica read is already current
A scheduled repair is not a completed durability or consistency guarantee. Subsequent reads still depend on the actual read protocol and repair progress.
58.Two large replicas need to locate differing key ranges without initially exchanging every record. What is a useful technique?
Show answer and explanation
- Compare only total database file size
- Compare the number of successful health checks
- Compare hierarchical range digests
- Sort hosts by their network addresses
Answer: Compare hierarchical range digests
Hierarchical hashes can narrow differences to smaller ranges. Matching file sizes or health counts do not establish equivalent data.
59.Replicas merge states in arbitrary order and may receive duplicate states. Which merge properties support deterministic convergence?
Show answer and explanation
- Strict dependence on arrival order
- Reliance on synchronized local display clocks
- A different rule for every retry
- Associativity, commutativity, and idempotence
Answer: Associativity, commutativity, and idempotence
Those algebraic properties make merge order and duplicate delivery harmless for the supported state model. Convergence still requires eventual exchange of relevant updates.
60.A counter only increases, with each replica owning its own component. How can merged states avoid counting the same replicated increment twice?
Show answer and explanation
- Sum entire received states on every delivery
- Average all replica totals after each message
- Take each component's maximum, then sum
- Choose the state with the longest hostname
Answer: Take each component's maximum, then sum
Per-replica monotonic components retain the greatest observed contribution. Adding whole received totals repeatedly would duplicate already represented increments.
61.A replicated set must distinguish removing an observed insertion from removing a later concurrent insertion of the same value. What metadata helps?
Show answer and explanation
- Distinct tags for individual insertion events
- One unversioned boolean for the whole set
- A shared constant timestamp for every operation
- Only the displayed value's character count
Answer: Distinct tags for individual insertion events
Insertion identities let the remove operation identify which additions it observed. A bare value or single boolean loses the concurrency information.
62.A conflict rule chooses the larger wall-clock timestamp. One writer's clock jumps ahead by an hour. What is a plausible consequence?
Show answer and explanation
- Its value can dominate later real-time updates
- The merge becomes independent of clock settings
- All writes remain ordered by actual completion time
- Every replica immediately detects the clock error
Answer: Its value can dominate later real-time updates
Wall-clock ordering can mistake clock error for a later update. Explain that tradeoff rather than claiming physical timestamps establish reliable causality.
63.Two version vectors are incomparable: each has a component greater than the other. What does that indicate under the vector-clock model?
Show answer and explanation
- Neither version causally dominates the other
- Both versions necessarily contain identical values
- The larger sum is the causal successor
- One machine has definitely crashed
Answer: Neither version causally dominates the other
Incomparable vectors represent concurrent causal histories. Their payloads may still happen to agree; vector comparison describes history, not value equality.
64.A comment refers to a newly created document. A replica receives the comment before the document. Which condition would causal delivery enforce?
Show answer and explanation
- Wait for all possible future comments
- Deliver the observed document dependency first
- Deliver the shorter record first
- Deliver every account's events in one global order
Answer: Deliver the observed document dependency first
A causally dependent update must not be exposed before its required predecessor. This does not require a total order over unrelated work.
65.Old data is encrypted with one key while new writes switch to another. What must a key-rotation plan retain until migration is verified?
Show answer and explanation
- Only the key used by the newest application version
- Only metadata proving that re-encryption was scheduled
- The new key until the first successful write completes
- The ability to decrypt still-retained old records
Answer: The ability to decrypt still-retained old records
Re-encryption and retirement must account for old data, replicas, and backups. Dropping needed key material prematurely can make valid retained data unreadable.
66.During a rolling upgrade, old and new readers coexist. What is a safe first step when introducing a new field?
Show answer and explanation
- Add it compatibly while old readers can still operate
- Immediately require it in every historical record
- Change existing field meaning without a version
- Delete the old representation before deploying readers
Answer: Add it compatibly while old readers can still operate
A compatible transition separates adding a representation from making it mandatory or removing the old one. Mixed-version behavior must be tested explicitly.
67.A release writes records the previous binary cannot parse. What does a binary-only rollback fail to address?
Show answer and explanation
- Compatibility of the already-written data
- The previous deployment replica count
- The old binary location in the artifact store
- The earlier request timeout configuration
Answer: Compatibility of the already-written data
Rolling back executable code does not undo persistent schema changes. Recovery needs a compatible reader, a reversible migration, or a documented forward repair.
68.New protocol handling is deployed gradually. When should senders start emitting a format old receivers reject?
Show answer and explanation
- Whenever the deployment dashboard first refreshes
- After the required receivers support that format
- As soon as the first sender is upgraded
- Before deploying any compatible receiver
Answer: After the required receivers support that format
Separate capability deployment from feature activation. Compatibility depends on the receiving population and rollback policy, not merely on one upgraded sender.
69.A report needs every shard for an exact total. One shard times out. What should the API avoid?
Show answer and explanation
- Offering a documented retry path
- Presenting the partial sum as the exact complete total
- Returning an explicit incomplete-result status
- Identifying the missing shard in diagnostics
Answer: Presenting the partial sum as the exact complete total
Partial data may be useful only under an explicit contract. An exact aggregate cannot silently omit a required shard and remain an exact total.
70.A search index is updated asynchronously after document writes. What should the product promise avoid without an additional mechanism?
Show answer and explanation
- Eventually indexing retained valid changes
- Reporting measurable indexing lag
- Immediate search visibility after every acknowledged write
- Allowing a direct authoritative document read
Answer: Immediate search visibility after every acknowledged write
Asynchronous indexing introduces a visibility gap. Read-your-writes search needs an explicit wait, overlay, routing rule, or other documented mechanism.
71.A backfill copies an old row after a newer update has already reached the destination through change capture. How can the destination avoid regression?
Show answer and explanation
- Disable all destination checksums
- Trust whichever packet arrives last
- Compare authoritative versions before applying the copy
- Prefer every backfill record over live changes
Answer: Compare authoritative versions before applying the copy
A late old snapshot must not overwrite newer captured state. Version-aware application and a coordinated snapshot/change-stream boundary prevent this race.
72.A change-data pipeline forwards inserts and updates but drops delete events. Which destination property is compromised?
Show answer and explanation
- The lexical ordering of field names
- Its maximum network transmission unit
- Faithful representation of the source's removals
- Its ability to allocate new storage blocks
Answer: Faithful representation of the source's removals
Without deletions or an equivalent reconciliation mechanism, the destination accumulates records the source no longer contains.
73.A processor advances its source checkpoint before making its output durable. What can a crash cause?
Show answer and explanation
- Guaranteed duplication of every processed item
- Lost output that recovery skips
- Blocking of source writes until the consumer restarts
- Automatic rollback of all output writes
Answer: Lost output that recovery skips
If recovery resumes after work whose effects were not durable, that work may never be reproduced. Coordinate output commitment and checkpoint advancement.
74.A writer commits data, then invalidates a cache. A reader that fetched older data earlier fills the cache afterward. What race remains?
Show answer and explanation
- The database commit is automatically undone
- The cache must detect the race from value length
- The invalidation guarantees all later fills are new
- The stale fill can repopulate the cache
Answer: The stale fill can repopulate the cache
Invalidation alone does not order in-flight fills. Version checks, generation tokens, or another coordinated caching protocol are needed.
75.A popular cached value expires and 800 requests simultaneously recompute it. What can request coalescing reduce?
Show answer and explanation
- Duplicate regeneration work for that value
- The underlying source's required correctness checks
- The lifetime of every unrelated cache entry
- The need for any overload budget
Answer: Duplicate regeneration work for that value
Coalescing lets one bounded regeneration serve multiple waiters. Its failure, timeout, and stale-value policies still need explicit treatment.
76.An absent username is cached as unavailable for ten minutes, then an account is created with that name. What needs attention?
Show answer and explanation
- Reading a different replica with the same negative entry
- Invalidating or bounding the stale absence result
- Increasing the positive-entry cache lifetime
- Refreshing only usernames that already exist
Answer: Invalidating or bounding the stale absence result
Negative entries cache absence as data. Creation can make them stale, so their invalidation and lifetime affect visibility just like positive cache entries.
77.A catalog caches assets by immutable content hash and checks a current manifest pointer on each request. Why can old asset cache entries remain safely reusable?
Show answer and explanation
- The manifest pointer never needs a consistency contract
- The same hash identifies the same verified content
- Cached assets can be edited in place without changing keys
- Every cached asset is automatically the newest release
Answer: The same hash identifies the same verified content
Immutable keys separate content reuse from release selection. Freshness comes from selecting the current manifest, while hash verification protects revision identity.
78.A global limit allows 1,000 operations per minute. Four independent nodes each enforce 1,000 locally. What is the aggregate flaw?
Show answer and explanation
- The limit is enforced by whichever node starts first
- The global allowance automatically falls to 250
- The four counters form a coordinated shared budget
- They can admit roughly 4,000 in the same minute
Answer: They can admit roughly 4,000 in the same minute
Independent full-size allowances add together. Enforce a shared budget or deliberately partition the allowance with a documented error model.
79.A token bucket has capacity 30 and refills at five tokens per second. It starts full and receives no refill during an instantaneous burst. How many one-token requests can pass immediately?
Show answer and explanation
- 150
- 6
- 5
- 30
Answer: 30
The initial burst is bounded by the 30 stored tokens. The refill rate controls how quickly capacity returns after the burst.
80.An inventory hold expires while a delayed payment confirmation is in flight. What must finalization check?
Show answer and explanation
- That the hold is still valid under the state-transition rules
- That the payment confirmation arrived over a reliable connection
- Only that a matching hold existed when payment began
- Only that the client retries with the original operation ID
Answer: That the hold is still valid under the state-transition rules
Finalization must atomically validate the current hold and apply a permitted transition. A historical identifier alone does not prove current ownership or availability.
81.A user pages through a changing dataset and requires a stable, complete view of the original result. What should the continuation token identify?
Show answer and explanation
- Only the last offset in the current live result
- A different random replica for each page
- Only the number of rows returned on the previous page
- The query position and an appropriate snapshot
Answer: The query position and an appropriate snapshot
A stable snapshot prevents concurrent insertions and removals from changing the result universe mid-pagination. Retention and token-expiry behavior must also be defined.
82.A file passes transport checks but is later stored under the wrong object identifier. What does an application-level digest tied to the intended object help verify?
Show answer and explanation
- The sender authorization without a trusted identity check
- The content delivered for that object's identity
- The object owner solely from the content bytes
- The availability of every intermediate service
Answer: The content delivered for that object's identity
End-to-end content validation can catch errors outside one transport segment. A digest does not by itself establish ownership or authorization.
83.An attacker can replace both a file and its unkeyed checksum. What additional property is missing from the checksum alone?
Show answer and explanation
- The ability to recompute the checksum
- Detection of random bit changes under normal use
- Authenticated integrity
- A fixed-length representation
Answer: Authenticated integrity
An unkeyed digest can detect accidental damage but does not authenticate a source that an attacker can impersonate. Use an appropriate trusted signature or MAC boundary.
84.A node misses a configuration update that revokes its write authority. Which design reduces reliance on that node noticing the update promptly?
Show answer and explanation
- Rely on the node periodically polling its role flag
- Use the node's last successful heartbeat as write authority
- Extend the configuration cache lifetime during failover
- Enforce versioned authority at the write destination
Answer: Enforce versioned authority at the write destination
A destination that validates current fencing or authorization state can reject stale actors. Monitoring alone does not enforce the revocation.
85.A failover drill moves application servers but still uses a name resolver in the failed site. What has the drill exposed?
Show answer and explanation
- A need for identical application replica counts
- A hidden dependency in the recovery path
- A failure that moving application servers alone has ruled out
- Proof that the database snapshots contain wrong rows
Answer: A hidden dependency in the recovery path
Recovery depends on the complete service chain, including naming, credentials, configuration, and control planes. Moving compute alone does not validate that chain.
86.Logs show one user action created two reservations on different nodes. What identifier would most directly connect both attempts for diagnosis?
Show answer and explanation
- A different random identifier for every log line
- Each process's current memory usage
- The stable logical operation identifier
- The length of the customer's name
Answer: The stable logical operation identifier
A shared operation identity distinguishes retries of one action from independent actions. Trace and attempt identifiers can add detail without replacing that logical link.
87.A team tests only clean process shutdowns. Which additional test targets ambiguous completed operations?
Show answer and explanation
- Change the dashboard refresh interval
- Lower image resolution in the client
- Restart only after every request has drained
- Drop the reply after durable application, then retry
Answer: Drop the reply after durable application, then retry
A lost response after commitment exercises the gap between server effect and client knowledge, revealing duplicate-handling and recovery errors that clean shutdowns miss.
88.A concurrency test checks whether every observed response fits a legal sequential history respecting completed-before-started operations. What is it evaluating?
Show answer and explanation
- Whether every replica uses the same file format
- The visual order of events in a dashboard
- Linearizability for the modeled object
- Whether mean latency is below one millisecond
Answer: Linearizability for the modeled object
A history checker compares operation intervals and responses with a specification. Its result is limited by the modeled object, recorded evidence, and tested executions.
89.A distributed test changes wall-clock time while leaving packet delivery normal. What class of assumptions can this probe?
Show answer and explanation
- Whether every disk block is physically adjacent
- Only the maximum network packet size
- Timestamp and lease behavior under clock changes
- Only the compiler's symbol table
Answer: Timestamp and lease behavior under clock changes
Clock perturbation targets code that equates wall time with elapsed time or ordering. It complements, rather than replaces, partition and pause tests.
90.One tenant creates many expensive scans while others issue small key lookups. Which admission policy better protects shared service?
Show answer and explanation
- Count all scans as zero-cost background work
- Allocate solely by the number of open browser tabs
- Account for per-tenant resource cost and concurrency
- Give every request unlimited execution time
Answer: Account for per-tenant resource cost and concurrency
Request counts alone may hide large cost differences. Fairness should reflect constrained resources and preserve explicit workload budgets.
91.Two services interpret a four-byte length prefix using different byte orders. What should their protocol specify?
Show answer and explanation
- The numeric range but no representation of its bytes
- The sender's native in-memory layout without a wire rule
- The receiver's host byte order for every sender
- The exact integer encoding and byte order
Answer: The exact integer encoding and byte order
A wire format must define how bytes represent values. Native in-memory conventions are not a portable network contract.
92.A TCP receiver gets one complete message and half of another in one read. What must its parser do?
Show answer and explanation
- Treat each read call as one complete application message
- Discard bytes beyond the first message
- Assume the second half was lost permanently
- Use explicit framing and retain the incomplete bytes
Answer: Use explicit framing and retain the incomplete bytes
TCP exposes an ordered byte stream, not application message boundaries. The parser must handle split and combined arrivals according to the framing format.
93.A dependency connection fails certificate verification after a deployment. What is the sound initial response?
Show answer and explanation
- Retry using the same invalid trust setup forever
- Inspect trust, hostname, validity, and deployed certificate evidence
- Disable verification across every environment
- Assume the application's database is corrupt
Answer: Inspect trust, hostname, validity, and deployed certificate evidence
Certificate failure has specific causes that should be investigated. Bypassing authentication conceals the fault and changes the security contract.
94.A valid service certificate suddenly appears not yet valid on one host after its clock changes. What should be compared first?
Show answer and explanation
- The number of entries in the application cache
- The certificate filename's character count
- The caller's average request payload size
- That host's time against trusted time and certificate validity
Answer: That host's time against trusted time and certificate validity
Certificate validity checks use time. A host clock error can explain a host-specific rejection even when the deployed certificate is otherwise appropriate.
95.Two editors read configuration version 12 and submit replacements that require version 12. What should an atomic compare-and-swap allow?
Show answer and explanation
- One succeeds; the other must refresh after the version changes
- The request with the earlier client timestamp wins
- The replacement with the larger serialized value wins
- Both succeed because they read the same initial version
Answer: One succeeds; the other must refresh after the version changes
An atomic version condition prevents blind lost updates. The losing editor must inspect the new state rather than silently overwrite it.
96.A dashboard reads a projection 40 seconds behind the source log. Which observation makes its lag interpretable?
Show answer and explanation
- Only the count of currently connected clients
- Only the most recent successful projector health probe
- The source position represented by the projection
- Only the time the dashboard HTML was rendered
Answer: The source position represented by the projection
A fresh page can display old data. Track the authoritative progress point or event time represented, together with its measurement assumptions.
97.A new voter needs hours to copy historical data. What is a common reason to catch it up before counting it toward an expanded quorum?
Show answer and explanation
- Avoid making normal commitment depend on an unready voter
- Eliminate the need to validate transferred state
- Guarantee that no existing voter can fail during transfer
- Permit independent old and new majorities immediately
Answer: Avoid making normal commitment depend on an unready voter
Adding an unready voting member can change quorum requirements before it can contribute. Membership protocols must preserve both safety and operational readiness.
98.A leader commits only after acknowledgments from a majority that necessarily includes a distant region. Which lower bound affects write latency?
Show answer and explanation
- The fastest unrelated replica's read latency
- Only the response body's text encoding time
- Communication with that required remote quorum
- Only the leader's local cache lookup time
Answer: Communication with that required remote quorum
Required remote agreement is on the critical path. Faster local processing cannot remove the communication needed by the chosen placement and commitment policy.
99.A feature needs an exact single-owner allocation, while an analytics panel tolerates delayed totals. What design principle follows?
Show answer and explanation
- Use the analytics lag to justify duplicate allocations
- Assume one timestamp solves both contracts
- Choose consistency separately for the two requirements
- Force both features to use identical semantics
Answer: Choose consistency separately for the two requirements
Different invariants need different guarantees. Explicitly map each operation's correctness and availability requirements rather than applying one vague consistency label everywhere.
100.A cluster shows divergent acknowledged state after a recovery drill. What should the investigation preserve before destructive repair?
Show answer and explanation
- Only successful requests after the drill finishes
- The repaired state after discarding divergent logs
- Logs, snapshots, request histories, and ownership transitions
- Only a current replica row-count comparison
Answer: Logs, snapshots, request histories, and ownership transitions
Preserve evidence needed to reconstruct the failure before repairs erase it. Then contain the incident and recover through the authoritative, reviewed procedure.