API gotchas
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.

    A downstream hangs on 5% of calls. How long do 200 threads last?

      App, gateway and service each make 3 attempts. How many calls per tap?

        2,000 requests a second at 50 ms. How many pooled connections?

          Build-up · 5 steps

          Watch the keep-alive race, step by step

          An ALB keeps idle connections for 60 s by default. A Node.js backend closes them after 5 s. Follow one pooled connection.

          Step 1 of 5

          A warm connection

          The backend answers and keeps the connection open. The balancer pools it, ready to reuse for the next request for up to 60 s.

          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 app, gateway and orders service each make 3 attempts. In an incident, the database is struggling. What do you change?”

            Your move. Pick an approach:

          2. Deep dive 2 of 4

            Interviewer

            “Two managers edit dish 42 at once. B’s full-form save undoes A’s price cut, and both got 200. What do you add?”

            Your move. Pick an approach:

          3. Deep dive 3 of 4

            Interviewer

            “Your /v1/me profile route uses session cookies, returns max-age=300 and sits behind a CDN. What do you change?”

            Your move. Pick an approach:

          4. Deep dive 4 of 4

            Interviewer

            “Cross-origin calls from app.example to api.example fail with a vague CORS error. The gateway demands a token on every request. Your fix?”

            Your move. Pick an approach:

          Build-up · 6 steps

          Walk one request through every hop

          The interview habit. At each hop, ask what the timeout is, what gets reused, what gets cached and what gets retried.

          Step 1 of 6

          Start at the client

          The app gets a short connect timeout and a 10 s total deadline, the only timer that protects its caller, even from a server that trickles bytes.