Chatty 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 · 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.

    What does an 80-item cart cost with two calls per line?

      What if pricing and inventory run in Singapore instead?

        How many calls hit the dependencies at the sale peak?

          Parallel instead of batched. How long, and how risky?

            Build-up · 6 steps

            Fix one cart page, step by step

            An 80-item cart that calls pricing and inventory once per line. Count it, batch it, keep the batch lean, then fix the write path too.

            Step 1 of 6

            The loop

            Each of 80 lines awaits a pricing call, then an inventory call. Every call pays the full round trip, so the page waits 240 ms for 16 KB of data.

            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

              “Each cart line calls pricing and inventory, awaited one by one, so 80-item carts take 240 ms. What do you change?”

              Your move. Pick an approach:

            2. Deep dive 2 of 4

              Interviewer

              “A product page reads 50 keys from a Redis cluster, one GET at a time. How do you cut the round trips?”

              Your move. Pick an approach:

            3. Deep dive 3 of 4

              Interviewer

              “After batching, the cart calls /products?ids=… and gets full product objects for all 80 items. Pages got heavier. What now?”

              Your move. Pick an approach:

            4. Deep dive 4 of 4

              Interviewer

              “An order service inserts one row per event in autocommit, thousands a second. How should it write them?”

              Your move. Pick an approach: