TCP vs UDP
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 · 9 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 does a 100 KB response take on a brand-new connection?

      How many new connections a second can a proxy open to one backend?

        How fast can one TCP flow go on a gigabit link at 1% loss?

          Build-up · 5 steps

          Watch TCP recover a lost segment

          A new connection, five numbered segments and one loss. How TCP turns best-effort IP into a reliable, ordered byte stream, and what that costs.

          Step 1 of 5

          Agree before any data

          SYN and SYN-ACK fix both sides’ starting sequence numbers. Three messages stop an old duplicate SYN posing as a new connection, but the request waits a full round trip.

          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

            “You’re designing a Zoom-style video-call app. How do you carry its APIs, its join-and-mute signals, and the audio and video?”

            Your move. Pick an approach:

          2. Deep dive 2 of 4

            Interviewer

            “Your multiplayer game sends each player a stream of world snapshots, and some packets get lost. How do you deliver them?”

            Your move. Pick an approach:

          3. Deep dive 3 of 4

            Interviewer

            “At peak, your gateway’s connect() calls fail with “Cannot assign requested address”. What do you change?”

            It opens a fresh connection per request to one backend IP and port, and closes each one itself.

            Your move. Pick an approach:

          4. Deep dive 4 of 4

            Interviewer

            “Your app’s HTTP/2 API stalls on lossy mobile networks: a lost image packet delays the JSON behind it. What do you change?”

            Your move. Pick an approach:

          Build-up · 4 steps

          Watch the congestion window grow and halve

          One connection’s window over its first 16 round trips (illustrative, Reno-style): why new connections start slow, and why recovering from one loss takes so long.

          Step 1 of 4

          Start at 10 segments

          RFC 6928 starts the window at 10 segments. A full Ethernet segment carries 1,460 bytes, so the first flight is about 14.6 KB.