Design Leader Election
"Design leader election" is a small prompt with a sharp safety edge. You run several identical copies of a service for availability, and some piece of work must be done by exactly one of them at any moment. There is almost no architecture to draw. There is a pool of interchangeable instances, one job that must not run twice, and a shared place to record who currently owns it. Instances crash, stall, and get cut off by the network. Through all of that, the system must never let two of them believe they are the leader at once. Get that one property right and the design is done. Get it wrong and you have two schedulers firing the same billing job or two coordinators handing out the same shard.
This is a senior backend shape, and it is a pure test of distributed-systems judgment. The prompt forces every coordination instinct to show up honestly. There is shared mutable state, the record of who leads, so you have to say where it lives and how a write to it is made atomic. There is failure, because the leader will die mid-term, so you have to detect that without a human watching and hand the role to someone else. There is the classic bug: the old leader that comes back thinking it is still in charge. You have to know what a fencing token is and why a timeout alone does not save you. And there is the partition question, because when the network splits you must choose safety over availability or accept split-brain. A candidate who reasons through all of that reads as someone who has run real distributed services. One who says "just use a flag in the database" and stops has not.
- 1 problem, worked step by step
- 1 diagram
- about 24 min
Premium lessonDiscord interview guide
These took digging.
What candidates walked out with, from 20,000+ reports, forum threads behind logins and write-ups in Chinese. Then solved step by step.
100 companies. Checked every month.
Unlock all 100 companies$49 a year · less than $1 a week · Cancel anytime
Discord interview guideKnow what Discord asks before you walk in.
28 coding · 6 system design · 19 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.