IT
Distributed Systems: Consensus & Fault Tolerance
Deep dive into distributed systems engineering, covering consensus protocols (Raft/Paxos), the CAP theorem, and vector clocks.
This is a free, 16-question multiple-choice quiz. Answer each question to see whether you got it right, with an explanation for every answer. There is no sign-up and no time limit — take it as many times as you like, and scroll down for the full answer key once you are done.
Question 1 of 16
0 correct
According to the CAP theorem, what trade-off must a distributed data store make during a network partition (P)?
Press A–D to choose · Enter to submit
Answer key & explanations
Every question in this quiz, with the correct answer marked and an explanation of why it is right. Use it to revise before or after taking the quiz above.
1.According to the CAP theorem, what trade-off must a distributed data store make during a network partition (P)?
- AChoose between zero latency (L) or low storage overhead (S)
- BChoose between consistency (C) or availability (A)✓ Correct
- CChoose between data durability (D) or horizontal scalability (H)
- DChoose between strong encryption (E) or multi-region replication (R)
Correct answer: Choose between consistency (C) or availability (A)
When network partitions occur, a distributed system must either reject writes/reads to maintain identical state (Consistency) or accept operations and risk divergent data (Availability).
2.In the Raft consensus algorithm, what mechanism prevents two leader candidates from perpetually splitting votes during an election?
- ARandomized election timeouts for each candidate node✓ Correct
- BEnforcing deterministic priority based on the node's IP address
- CRouting all election votes through a designated master witness node
- DTriggering two-phase commits across all cluster members
Correct answer: Randomized election timeouts for each candidate node
Raft uses randomized election timeouts (e.g., 150ms–300ms) so one node times out and initiates an election before others, avoiding split votes.
3.What constitutes a 'split-brain' scenario in a distributed cluster?
- AWhen a CPU core executes two conflicting machine instructions simultaneously
- BWhen network disconnection causes distinct sub-clusters to each believe they are the legitimate leader✓ Correct
- CWhen an operating system fails to flush dirty page cache to SSD storage
- DWhen memory addresses are corrupted across non-uniform memory access (NUMA) nodes
Correct answer: When network disconnection causes distinct sub-clusters to each believe they are the legitimate leader
Split-brain occurs when a network partition cuts cluster communication, causing nodes on both sides to elect independent leaders and accept conflicting writes, risking corruption.
4.What does a Vector Clock capture in distributed systems that standard Lamport Timestamps cannot?
- APhysical wall-clock time synchronized via GPS satellites
- BThe exact causal relationship and concurrency between distinct distributed events✓ Correct
- CThe network packet round-trip latency between servers
- DThe disk write throughput across distributed storage nodes
Correct answer: The exact causal relationship and concurrency between distinct distributed events
While Lamport timestamps provide total ordering, vector clocks maintain vector arrays that can differentiate whether two events are causally related or occurred concurrently.
5.Why is Two-Phase Commit (2PC) considered a blocking protocol in distributed database transactions?
- AIt blocks non-relational JSON schemas from participating
- BIf the coordinator crashes permanently after the prepare phase, participants must wait indefinitely for a decision✓ Correct
- CIt locks the operating system kernel from servicing incoming network packets
- DIt forces disk drives to perform synchronous sector zeroing
Correct answer: If the coordinator crashes permanently after the prepare phase, participants must wait indefinitely for a decision
In 2PC, if participants vote 'yes' and the coordinator fails before broadcasting 'commit' or 'abort', participants cannot independently resolve the transaction and hold locks indefinitely.
6.What fundamental problem does the Paxos consensus algorithm solve?
- ACompiling distributed source code across heterogenous CPU architectures
- BReaching agreement on a single value among a group of unreliable processors over an asynchronous network✓ Correct
- CEncrypting database backups with decentralized zero-knowledge proofs
- DRouting BGP traffic across border internet gateway routers
Correct answer: Reaching agreement on a single value among a group of unreliable processors over an asynchronous network
Paxos guarantees safety and consensus among distributed nodes communicating over an asynchronous, lossy network, as long as a quorum of non-faulty nodes is reached.
7.What is Linearizability (or strong consistency) in distributed storage systems?
- AAll read and write operations appear to take place atomically at a discrete point in time between their invocation and completion✓ Correct
- BData is guaranteed to replicate across all geographic nodes within 500 milliseconds
- CEvery write operation is saved linearly to an append-only flat file on a single node
- DOperations are ordered purely by the local wall-clock timestamp of the client
Correct answer: All read and write operations appear to take place atomically at a discrete point in time between their invocation and completion
Linearizability ensures that every operation appears to execute atomically at a specific instant between its start and finish, matching the behavior of a single, central copy of data.
8.How does Google Spanner achieve globally consistent transactions without blocking reads?
- ABy routing all global writes through a single central server in California
- BBy utilizing TrueTime API, which leverages GPS receivers and atomic clocks to bound timestamp uncertainty✓ Correct
- CBy enforcing eventual consistency and using conflict-free replicated data types
- DBy running an asynchronous gossip protocol over private submarine fiber cables
Correct answer: By utilizing TrueTime API, which leverages GPS receivers and atomic clocks to bound timestamp uncertainty
Google Spanner's TrueTime API provides bounded time uncertainty intervals backed by atomic clocks and GPS, allowing the database to assign monotonic commit timestamps globally.
9.What is the primary role of a Quorum in distributed consensus systems such as Raft or Cassandra?
- ATo ensure that read and write operations intersect at least one up-to-date node by satisfying R + W > N✓ Correct
- BTo distribute cryptographic keys to newly joined cluster members
- CTo balance network packet sizes across physical network switches
- DTo ensure every single server in the cluster agrees unanimously before committing writes
Correct answer: To ensure that read and write operations intersect at least one up-to-date node by satisfying R + W > N
A quorum (strictly majoritarian, or configured such that Read quorum + Write quorum > Total nodes) guarantees that any successful read operation overlaps with at least one node containing the latest write.
10.What is the purpose of a Gossip Protocol in large-scale decentralized systems like Apache Cassandra?
- ATo elect a single perpetual benevolent dictator node for the cluster
- BTo efficiently disseminate cluster membership, node state, and failure detection information peer-to-peer✓ Correct
- CTo serialize database records into protocol buffer formats
- DTo block rogue IP addresses at the Linux iptables level
Correct answer: To efficiently disseminate cluster membership, node state, and failure detection information peer-to-peer
Gossip protocols periodically exchange state metadata between random peer pairs, eventually diffusing cluster membership and node health across the entire network in O(log N) rounds.
11.What is the Byzantine Generals Problem in distributed computing?
- AReaching consensus when nodes may not only fail or drop packets, but also send conflicting or malicious messages✓ Correct
- BPreventing memory leaks inside long-running background worker processes
- CCoordinating threads on a multi-core processor with shared L3 cache
- DHandling network disconnections caused by undersea fiber cable cuts
Correct answer: Reaching consensus when nodes may not only fail or drop packets, but also send conflicting or malicious messages
The Byzantine Generals Problem models scenarios where actors can act maliciously or deceitfully (arbitrary/Byzantine faults), requiring algorithms like PBFT to guarantee consensus.
12.In distributed storage, what is a Conflict-Free Replicated Data Type (CRDT)?
- AA data structure that can be replicated across nodes and resolved concurrently without coordination or merge conflicts✓ Correct
- BA file format that locks a document exclusively to a single active author
- CA relational database table containing foreign key cascading deletes
- DA cryptographic hash tree used to verify file integrity on disk
Correct answer: A data structure that can be replicated across nodes and resolved concurrently without coordination or merge conflicts
CRDTs (operation-based or state-based) rely on mathematically commutative and idempotent operations, allowing concurrent updates across replicas to converge to the exact same state without locks.
13.What is the primary vulnerability of relying on Network Time Protocol (NTP) for ordering distributed events?
- ANTP packets cannot traverse standard IP routers
- BClock drift, network jitter, and leap seconds make physical clocks unreliable for strict global ordering✓ Correct
- CNTP requires specialized high-performance graphics hardware to decode timestamps
- DNTP timestamps roll over and reset to zero every twenty-four hours
Correct answer: Clock drift, network jitter, and leap seconds make physical clocks unreliable for strict global ordering
NTP cannot guarantee perfect physical clock synchronization due to network latency, virtualization skew, and clock drift, making reliance on wall-clock time risky for transactional ordering.
14.What is the function of an Epoch number (or Term number) in consensus protocols like Raft and Zab?
- ATo record the Unix timestamp when the server was initially racked
- BTo distinguish between older, stale leadership reigns and current cluster states✓ Correct
- CTo identify the software version of the running daemon binary
- DTo count the number of network packets transmitted over a socket
Correct answer: To distinguish between older, stale leadership reigns and current cluster states
Epoch/term numbers act as logical clocks, allowing nodes to identify and disregard outdated commands or heartbeats emitted by disconnected or partitioned former leaders.
15.How does Read-Repair work in distributed databases with eventual consistency?
- AIt recompiles corrupted database binaries automatically
- BDuring a read query, the coordinator compares data versions from multiple replicas and asynchronously updates out-of-date nodes✓ Correct
- CIt forces the client application to rewrite its SQL queries using prepared statements
- DIt recovers damaged sectors on local solid-state storage drives
Correct answer: During a read query, the coordinator compares data versions from multiple replicas and asynchronously updates out-of-date nodes
When a client reads data with a high consistency level, the coordinator queries multiple replicas; if it detects stale data, it returns the latest version to the client and writes updates to the stale nodes.
16.What does the FLP Impossibility result (Fischer, Lynch, and Paterson) prove?
- ANo distributed system can scale beyond 10,000 independent physical nodes
- BDeterministic consensus is impossible to guarantee in an asynchronous network if even a single process is subject to unannounced crash failure✓ Correct
- CTwo-phase commit is mathematically optimal for all distributed systems
- DVector clocks cannot prevent data loss during power outages
Correct answer: Deterministic consensus is impossible to guarantee in an asynchronous network if even a single process is subject to unannounced crash failure
The landmark 1985 FLP theorem proved that in a purely asynchronous network, no deterministic consensus protocol can guarantee both safety and liveness if even one node can crash.
More free quizzes
- ITLLM Engineering: Fine-Tuning, Alignment & ServingTest your knowledge of transformer architectures, PEFT techniques (LoRA), RLHF, vLLM, and production deployment strategies.16 questions
- ITApplied AI: Systems, Embeddings & RAGAssess your understanding of practical machine learning architectures, embedding spaces, and Retrieval-Augmented Generation systems.16 questions
- ITFrontend Architecture: Micro-Frontends & RenderingEvaluate your knowledge of Modern Frontend Architecture, SSR, SSG, Hydration mechanics, Islands Architecture, and Module Federation.16 questions