Consensus
0-day streakReview

Your progress

Level 1

0 XP100 XP to level 2
0day streak
0best streak
0topics started
0cards reviewed
    Review cards

    Progress is stored only in this browser. No account is required.

    Layer 3 · Go deeper · 5 min

    Go deeper

    Size it, build it, then make the calls an interviewer will push you on.

    Back of the envelope

    Size it up

    Tap through each step of the arithmetic.

    How many writes a second can one etcd cluster take?

      Build-up · 6 steps

      Watch a Raft election, split vote and all

      Five servers, randomised timeouts and an unlucky moment. The leader crashes, two followers stand almost together, and Raft still ends with one leader.

      Step 1 of 6

      Term 1: heartbeats hold

      S1 leads term 1 and sends heartbeats, AppendEntries calls with no entries, every 50 ms. Each one resets every follower’s election timer, so nobody stands while the leader is alive.

      4 interview moments

      You’re the candidate

      The interviewer pushes on the hard parts. Pick an approach and see how it holds up.

      1. Deep dive 1 of 4

        Interviewer

        “Your etcd cluster spans three zones and must keep accepting writes if any one zone fails. How many members, and where?”

        Your move. Pick an approach:

      2. Deep dive 2 of 4

        Interviewer

        “Five members sit two in Mumbai, two in Hyderabad, one in Singapore. Where should the leader live?”

        Assume round trips of 1 ms within Mumbai, 20 ms Mumbai–Hyderabad and about 60 ms from either city to Singapore.

        Your move. Pick an approach:

      3. Deep dive 3 of 4

        Interviewer

        “Your config service must never return stale reads, but appending every read to the log costs a disk write. What do you do?”

        Your move. Pick an approach:

      4. Deep dive 4 of 4

        Interviewer

        “One member of your three-node etcd cluster has died. How do you replace it?”

        Your move. Pick an approach: