Strava
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.

    How many uploads a second at the Sunday peak?

      How much raw data lands every year?

        How many leaderboard writes a second at peak?

          Can the segment index fit in memory?

            Build-up · 6 steps

            Build the high-level design

            One functional requirement at a time, ending with a design that works before any scaling.

            Step 1 of 6

            Upload, even hours later

            The Upload API does as little as possible. It hashes the file, stores the raw bytes, enqueues a message and returns 202. A retry carries the same hash and gets the same upload ID.

            6 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 6

              Interviewer

              “Sunday morning, uploads hit five times the average. How do you absorb that without losing or duplicating any?”

              Your move. Pick an approach:

            2. Deep dive 2 of 6

              Interviewer

              “Assume 40 million user-drawn segments. How do you find the few this run crossed?”

              Your move. Pick an approach:

            3. Deep dive 3 of 6

              Interviewer

              “Efforts change thousands of times a second, from uploads, crops, deletes and privacy settings. How do you keep every board exactly right?”

              Your move. Pick an approach:

            4. Deep dive 4 of 6

              Interviewer

              “Every activity has thousands of GPS points. Where do the streams of a billion activities live?”

              Your move. Pick an approach:

            5. Deep dive 5 of 6

              Interviewer

              “Product wants a global heatmap of everywhere people run and ride. How do you build it?”

              Your move. Pick an approach:

            6. Deep dive 6 of 6

              Interviewer

              “You publish a global heatmap built from public activities. How do you make sure it exposes nobody?”

              Your move. Pick an approach:

            Build-up · 8 steps

            Follow one Sunday run through it

            The upload path is short and synchronous. Everything after the 202 consumes an event, so each part scales, fails and catches up on its own.

            Step 1 of 8

            Accept

            The phone posts the FIT file. The Upload API checks the hash, stores the bytes, publishes to the uploads topic and returns 202 in about 150 ms.