Proximity search
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.

    Can a full scan serve 5,000 searches a second?

      How many rows does a 3 km lat/lng box read?

        How far must you look for the nearest 20 restaurants?

          How many Redis primaries for a million live drivers?

            Build-up · 5 steps

            Match a rider to a driver

            An outskirts pickup with few drivers nearby. Each step is one move matching makes, from the live index to the offer.

            Step 1 of 5

            Pings land in cell sets

            Each driver’s phone pings every 4 seconds. The location service writes the latest position to its cell’s Redis geo set, and a sweeper drops anyone silent for 30 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

              “Users search restaurants that deliver to them, filtered by “open now” and “biryani”. Which index?”

              Your move. Pick an approach:

            2. Deep dive 2 of 4

              Interviewer

              “You key restaurants by geohash for a 3 km search and read a block of cells. Which length?”

              Your move. Pick an approach:

            3. Deep dive 3 of 4

              Interviewer

              “A million drivers ping every 4 seconds. Where do the pings go?”

              Your move. Pick an approach:

            4. Deep dive 4 of 4

              Interviewer

              “Two riders’ searches both rank driver B first. How do you avoid offering B twice?”

              Your move. Pick an approach: