advancedReal-World Systems~60 min
Raft — Leader Election
Elect a single leader in a cluster where nodes crash and messages drop — the heart of the Raft consensus algorithm. Implement the election: a node bumps its term and becomes a candidate, peers grant at most one vote per term, a candidate that wins a majority becomes leader, and any node that sees a newer term immediately steps down. The mechanism that keeps etcd, Consul, and CockroachDB consistent.