Consensus and Coordination Algorithms Questions

How independent nodes agree on shared state: Paxos and Raft, leader election, quorum reads and writes, distributed locks, coordination services such as ZooKeeper or etcd, and Byzantine fault tolerance for replicas that cannot be trusted. Covers split-brain avoidance, fencing tokens, and the cost of coordination on throughput and latency. Frames when consensus is required versus when it can be designed away.

HardTechnical
43 practiced

Describe and provide pseudo-code for a robust Redis-based distributed lock with TTL that prevents lock-stealing and avoids deadlocks where possible. Include acquire, renew, and release logic, owner identifiers, and safety checks, and discuss failure modes such as client crash, clock skew, and network partitions.

EasyTechnical
48 practiced

Why does a distributed database need leader election? Describe common algorithms and systems used for it (Raft, Paxos, ZooKeeper, etcd), how leader election affects availability, and what an architect must consider during network partitions and leader churn.

HardTechnical
47 practiced

In Go, implement a robust leader election and heartbeat mechanism using an etcd v3 cluster. Use leases/TTLs to hold leadership, acquire leadership with a compare-and-swap on a leadership key, renew leases periodically, and ensure graceful stepdown on failure. Provide a code skeleton using clientv3 showing lease creation, txn-based contest for the key, and lease keep-alive handling.

EasyTechnical
44 practiced

Explain how leader election works in Raft at a high level. Describe the role of election timeout, candidate state, vote granting rules, term numbers, and how Raft minimizes the likelihood of split votes.

MediumTechnical
49 practiced

Why are snapshots necessary in Raft, and how does installing a snapshot to a follower interact with in-flight AppendEntries and state-machine application?

Unlock Full Question Bank

Get access to all 44 Consensus and Coordination Algorithms interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.