Timeouts & retries
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.

    A dependency hangs on 2% of calls. How many threads get stuck?

      Does checkout’s retry loop fit inside the gateway’s 1-second budget?

        One request needs answers from 100 servers. How often is it slow?

          Build-up · 5 steps

          Watch one tap become 243 database calls

          One user action through a five-layer call chain, while the database at the bottom browns out.

          Step 1 of 5

          Five layers, three tries each

          A tap crosses five layers to reach the database, and each makes up to three attempts per call. Defaults like this hide in SDKs, RPC frameworks, sidecars and load balancers.

          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 call inventory 2,000 times a second. Its p50 is 8 ms, p99 40 ms, p99.9 90 ms. Where do you set the timeout?”

            Your move. Pick an approach:

          2. Deep dive 2 of 4

            Interviewer

            “Your charge call times out after the request was sent. The customer is still watching the spinner. What does your client do?”

            Your move. Pick an approach:

          3. Deep dive 3 of 4

            Interviewer

            “A database failover makes 1,000 clients fail at the same moment. How should they time their retries?”

            Your move. Pick an approach:

          4. Deep dive 4 of 4

            Interviewer

            “In a full outage, three attempts per request nearly triples the load on a dependency that’s already down. How do you cap it?”

            Your move. Pick an approach: