Consensus, leader election, clocks, idempotency, retries, circuit breakers, microservices patterns and event-driven design.
39 cards · basic cards · AI-written, checked twice. Edit anything.
- What is the consensus problem in distributed systems?
Show answer
The requirement that all non-failed processes agree on a single value, even when some processes fail.
- How does Raft simplify consensus compared to Paxos?
Show answer
Raft decomposes the problem into leader election, log replication, and safety, with one leader at a time managing all log entries.
- What are the three roles in Paxos?
Show answer
Proposer (proposes values), Acceptor (votes on proposals), and Learner (learns the decided value).
- What is a quorum in consensus algorithms?
Show answer
A majority subset of processes, typically more than half, whose agreement guarantees a consensus decision.
- What is a term in Raft?
Show answer
A logical clock number that increments each time a new leader is elected, used to detect stale leaders and outdated information.
- What is the split brain problem in leader election?
Show answer
A condition where network partitioning causes two separate leaders to exist, each believing it is the only legitimate leader.
- How does Raft prevent split brain?
Show answer
By requiring a leader to have a quorum of followers committed to its leadership term, ensuring only one leader per term.
- What is a heartbeat in Raft?
Show answer
A periodic message from the leader to followers indicating it is alive and maintaining leadership.
- What happens when a follower does not receive a heartbeat?
Show answer
The follower times out, increments its term, and starts a new election by voting for itself and requesting votes from others.
- What is election timeout in Raft?
Show answer
A randomized duration a follower waits before initiating an election if no heartbeat is received from the leader.
- What is physical time?
Show answer
Actual wall-clock time measured by hardware clocks, which can drift and are not perfectly synchronized across systems.
- What is a logical clock?
Show answer
A counter that orders events causally without requiring synchronized physical clocks, incrementing on local events and receiving messages.
- How does Lamport timestamp order events?
Show answer
Each process maintains a counter; on any event it increments the counter, and on receiving a message it sets the counter to the max of its counter and the message's timestamp plus one.
- What is a vector clock?
Show answer
A logical clock mechanism where each process maintains a vector of counters, one per process, tracking causal dependencies between all processes.
- What is clock skew?
Show answer
The difference in time readings between different clocks in a distributed system due to drift and synchronization errors.