advanced practice · system design prompt
Leader election walkthrough
Walk through Raft leader election: timeouts, candidacy, vote granting, split votes. Trace what happens when the current leader is partitioned from a majority.
The mechanism
Consensus is how a cluster agrees on one value despite crashes and network delays. Raft makes it understandable: elect a leader, replicate an append-only log, and a write commits once a majority (quorum) has it. A majority guarantees any two quorums overlap.
Expected evidence
A 3-node trace showing one election cycle, including a split-vote retry.
Try this drill in the practice workspace →
Hints when you need them
- Randomized election timeouts break split-vote loops.
- Majority quorum, not consensus, is what guarantees safety.
Watch for these mistakes
- Assuming consensus survives a network partition without a majority
- Confusing leader election with data replication — Raft does both
- Thinking more replicas always means more durability (it costs latency)