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

    How long does the seven-service product page take?

      How often may each of seven calls be slow, for 1% slow pages?

        How available is a page that needs all seven services?

          What does request-time composition cost at sale peak?

            Build-up · 5 steps

            One query across three subgraphs

            Three teams each own part of Product. Follow one query through the router, from plan to merged answer.

            Step 1 of 5

            Three subgraphs

            Products, Pricing and Reviews each declare their share of Product, keyed by id with @key. Composition merges them into one supergraph.

            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

              “The product page takes 130 ms. The Reviews team offers to halve its 60 ms call. Take the offer?”

              Your move. Pick an approach:

            2. Deep dive 2 of 4

              Interviewer

              “During a sale, Recommendations turns slow and drags the product page down. What do you do?”

              Your move. Pick an approach:

            3. Deep dive 3 of 4

              Interviewer

              “The shopper app, website and seller app are built by three teams, and their needs keep diverging. One shared composer, or BFFs?”

              Your move. Pick an approach:

            4. Deep dive 4 of 4

              Interviewer

              “Ops wants every order over ₹5,000 from Pune customers with an open refund ticket. Compose it at request time?”

              Your move. Pick an approach: