Peer-to-peer
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 · 7 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 long to send a 2 GB patch to a million players?

      How many messages does one flooded query send?

        What do 10,000 relayed video calls cost your TURN servers?

          Build-up · 5 steps

          Follow one Kademlia lookup to its key

          8-bit IDs for readability; real IDs are 160 bits. Distance is the XOR of two IDs, read as a number.

          Step 1 of 5

          Start: every bit differs

          You want key 10110010, and your ID 01001101 differs in every bit, XOR distance 255. You ask the α = 3 closest nodes you know, in parallel, for anyone closer.

          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

            “A 2 GB patch must reach a million players, and you have one 10 Gbit/s origin. How do you deliver it?”

            Your move. Pick an approach:

          2. Deep dive 2 of 4

            Interviewer

            “Your swarm must keep finding peers even if the tracker goes down. How do clients learn who holds an info hash?”

            Your move. Pick an approach:

          3. Deep dive 3 of 4

            Interviewer

            “Two users on mobile data, both behind carrier-grade NAT, start a 1:1 video call. How do you connect them?”

            Your move. Pick an approach:

          4. Deep dive 4 of 4

            Interviewer

            “Your 1:1 WebRTC calls run peer to peer. Product now wants six-person meetings. How does the media flow?”

            Your move. Pick an approach: