Synchronous I/O
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 · 8 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.

    What caps a 200-thread checkout service?

      How long does the newest request wait after 10 seconds?

        Payments hangs. How much does a timeout help?

          How big should the payment bulkhead be?

            Build-up · 6 steps

            Fix a checkout that waits on payments

            One service from healthy to cascading to fixed. Each step bounds how long, or how many, requests can wait on payments.

            Step 1 of 6

            One pool, every route

            Checkout, cart and health checks share 200 threads. Each checkout holds one for 50 ms, 48 of them waiting, so 1,000 a second keep 50 busy.

            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

              “During a sale, the payment provider’s p99 goes from 300 ms to 5 s, and your product page dies too. What do you do first?”

              Your move. Pick an approach:

            2. Deep dive 2 of 4

              Interviewer

              “A Spring Boot checkout on JDBC and a blocking HTTP client keeps running out of threads. Rewrite it async, or switch to virtual threads?”

              Your move. Pick an approach:

            3. Deep dive 3 of 4

              Interviewer

              “A FastAPI async def handler calls requests.get and a synchronous Postgres driver. Every route’s p99 jumped. What do you change?”

              Your move. Pick an approach:

            4. Deep dive 4 of 4

              Interviewer

              “A queue consumer runs 16 workers, each blocking on a file upload. Should you convert it to async I/O?”

              Your move. Pick an approach: