The Runtime Theory
mediumSystemInternals#explain-the-model#reason-about-tradeoffs

Explain Raft Uses Terms and Quorums to Choose a Leader

Explain the model, execution steps, complexity, and limits of raft uses terms and quorums to choose a leader.

TRT practice prompt — not a verified question from a named employer.

The Runtime Theory Team6 min read

Interview prompt

Explain raft uses terms and quorums to choose a leader to an engineer who understands the surrounding system but has not used this technique. Walk from its contract to a concrete operation, then discuss where it fails or becomes expensive.

A strong answer

Consensus lets a group of processes agree on an ordered sequence of decisions despite specified failures. Raft separates leader election, log replication, and safety rules into understandable mechanisms. It assumes crash failures and a communication network that can delay, drop, or reorder messages.

Each server tracks a current term. A candidate requests votes; a server grants at most one vote per term under the protocol’s log-freshness rule. A leader appends client commands to its log and considers an entry committed once the required majority has replicated it, subject to Raft’s commit rules.

A complete answer also calls out the assumptions that control correctness. A majority quorum tolerates some unavailable servers but cannot make progress if a majority cannot communicate. Network partitions may create temporary competing leaders in different terms, while safety rules prevent committed history from being overwritten. Consensus does not solve application-level deduplication or external side effects.

Close by describing one representative test or measurement. In a five-server group, how many servers form a majority? What happens to write availability if three servers are mutually isolated from the remaining two?

Follow-up questions

Answer the follow-ups in the frontmatter. Use the linked article for the concept and the trace to make the explanation concrete.

This answer walks

Practice follow-ups

  1. 01Which assumption is essential for the approach to be correct?
  2. 02What is the worst case, and how does it change the resource cost?
  3. 03How would you adapt the design if the input or workload became much larger?
  4. 04What boundary test would give you the most confidence in the implementation?

One dispatch a week

The trace behind each question, the tradeoff that explains it, and one technical dispatch per week — no noise.

One technical dispatch per week. No noise.

Not started

Sign in to save your learning progress.

Sign in to save