Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

System Design (High-Level Design) Module 25

Case studies: location, mobility and logistics interview questions

Interview questions on “Case studies: location, mobility and logistics”: warm-ups, then what each harder question tests and how a good answer starts.

23 questions: 3 warm-ups and 20 with model answers · Levels: Fresher to staff

Warm-up questions

Short questions with short answers, each answered in full.

  1. Fresher to mid

    Why do ride-hailing systems keep driver positions in memory instead of a database?

    Answered in the lesson Design ride hailing like Uber or Ola: matching

  2. Fresher to mid

    Why match on pickup time rather than distance?

    Answered in the lesson Design ride hailing like Uber or Ola: matching

  3. Fresher to mid

    Why does a food delivery order need a timeout for the restaurant to accept it?

    Answered in the lesson Design food delivery like Swiggy

Questions with model answers

What each question tests, the first step of a good answer and the follow-ups to expect.

  1. Mid to senior

    Two matcher instances serve one city. A few drivers a day end up assigned to two riders at once. Explain how that can happen, how you would confirm it from the logs, and what you change so that it cannot happen again.

    What it tests
    Seeing a check-then-act race across instances, and fixing it with conditional updates, versions, expiry checked by the store and idempotent accepts.
    First step
    Look for pairs of offers to the same driver created within the matcher's gap between reading the driver and writing the offer, a few hundred milliseconds. If both offers were written, the write trusted a stale read. The fix is one conditional statement that checks the state and the version it read, not a second read before the write.
    Follow-ups

    From the lesson Design ride hailing like Uber or Ola: matching

    Model answer, Pro. Model answers open with any pass; prices are in the notice on this page.

    Opening the model answers with your pass…

    Model answers open with any MySmartCoPilot pass.

    • Pro pass · 1 week₹79$2.99
    • 30 days₹179$5.99
    • 1 year₹1,699$45

    One payment; a pass never renews. The price shown is the total you pay: no fees or charges are added at checkout.

    It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  2. Senior to staff

    A stadium event ends and 30,000 people open the app within ten minutes, all inside four cells, while 400 drivers are nearby. What breaks in the matching path, and how do you keep matching useful for everyone?

    What it tests
    Reasoning about supply against demand first, then hot cells and shards, batch matching under scarcity, honest waiting, shedding by criticality and protecting the ETA service.
    First step
    Compare demand with supply before any design: 30,000 people for 400 drivers is 75 riders per driver, so most riders cannot get a car within minutes whatever the design does. The job is to keep the hot shard and the ETA service healthy, match the drivers who exist well, and tell everyone else the truth quickly.
    Follow-ups

    From the lesson Design ride hailing like Uber or Ola: matching

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  3. Mid to senior

    A user in a sparse suburb searches for pharmacies near them and sees 3 results, although 15 exist within 5 km. The index uses geohash cells at precision 6 and reads the 3 × 3 block around the user. What is wrong, and how do you fix it without slowing down searches in busy areas?

    What it tests
    Understanding what a block of cells covers, a stopping rule that makes nearest-k exact, and choosing cell sizes by density.
    First step
    Work out what the block covers: precision-6 cells are roughly 1.2 km by 0.6 km here, so a 3 × 3 block reaches only about 0.6 km in its narrowest direction from the user. Places beyond that are never read, whatever their rank.
    Follow-ups

    From the lesson Design proximity search like Yelp

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  4. Mid to senior

    A cafe that opened last week has two 5-star ratings and now ranks above a nearby cafe rated 4.6 from 1,200 ratings. Product wants new places to stay visible but not to jump ahead like this. Design the rating part of the ranking, with numbers.

    What it tests
    Rating confidence with a prior, how the prior weight changes outcomes, and keeping new places discoverable without letting a few ratings dominate.
    First step
    Ask how much evidence each average rests on: two ratings say little, 1,200 say a lot. Rank by an average that is pulled towards the city's average by a fixed number of imaginary ratings, so that a few real ratings move it only a little. Then work both cafes through it with numbers, and choose that number from data.
    Follow-ups

    From the lesson Design proximity search like Yelp

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  5. Senior to staff

    At lunch, nearby searches in one business district rise to 4,000 a second. Design the caching so that the search servers see at most a few hundred a second from that district, without ever showing a place as open after it has closed.

    What it tests
    Cache key design for location queries, normalising filters, separating time-dependent filters from cached answers, lifetimes and protecting servers when the cache is cold.
    First step
    Decide what a cached answer is: a list of candidates for a cell, a category and normalised filters, long enough to filter and page through. Leave anything time-dependent, such as open-now, out of the key and apply it when the answer is served.
    Follow-ups

    From the lesson Design proximity search like Yelp

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  6. Mid to senior

    On a bad network a driver's phone sends "complete trip" three times, and one copy arrives ten minutes later, after the rider has already disputed the fare. Design the trip's state changes so that this can never charge twice or reopen a settled trip.

    What it tests
    Idempotency keys with stored results, conditional writes on a version, legal transitions, outbox events, and how disputes and late messages interact with a state machine.
    First step
    Give every command an idempotency key made on the phone and the trip version it saw. The store applies a command with one conditional write only when the move is legal and the version matches, saves the result under the key, and writes one event in the same transaction. A late copy then finds its key and returns the saved result.
    Follow-ups

    From the lesson Design ride hailing: trips, pricing, payments

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  7. Senior to staff

    During evening rain, the surge multiplier in one area jumps between 1.0 and 2.1 from minute to minute, and riders complain that the price changes every time they open the app. Design the surge computation so that prices follow real changes without flapping.

    What it tests
    Windowed supply and demand counts per cell, smoothing and hysteresis with their lag, neighbour smoothing, quote locking, and guardrails such as caps.
    First step
    Separate measurement from publication. Keep counting requests and available drivers per cell in one-minute windows, but publish a multiplier computed from a smoothed ratio, changed only by a meaningful step and held for a few minutes; then measure how many minutes of lag that costs.
    Follow-ups

    From the lesson Design ride hailing: trips, pricing, payments

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  8. Senior to staff

    Design payment for trips that can be paid by card, from a wallet or in cash, where the final fare is known only at the end and the rider may cancel at any point. Where are the points of no return, and what does each failure undo?

    What it tests
    Modelling payment as a saga with compensable, pivot and retryable steps, card hold rules, idempotent gateway calls, and a double-entry ledger for wallets and cash.
    First step
    Lay out the steps for each method and mark each one as undoable, the point of no return, or retried until it succeeds. Start with the card, where the money is held at booking, captured at the end and released on cancellation, and ask which of those steps can no longer be undone once it has happened.
    Follow-ups

    From the lesson Design ride hailing: trips, pricing, payments

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  9. Senior to staff

    It starts raining at dinner time in a big city. Orders rise by 40 %, 30 % of riders log off and traffic slows. What does the platform do in the next 30 minutes, and how does it decide how far to go?

    What it tests
    Capacity reasoning with Little's law per zone, the levers that change demand and minutes per order, and keeping the critical paths up while being honest with customers.
    First step
    Compute, per zone, the riders the orders now need: orders a minute times the minutes each order keeps a rider busy, divided by the share of time riders can be busy. Compare it with riders online. The gap, not the rain, decides which levers to pull and how hard.
    Follow-ups

    From the lesson Design food delivery like Swiggy

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  10. Mid to senior

    When should one rider carry two orders? Describe the rule you would use in real time, and put numbers on what it costs the first customer and what it saves the platform.

    What it tests
    Batching conditions on place, time and direction, protecting the first customer's promise, and measuring rider time as well as delivery time.
    First step
    State the conditions under which a second order fits: picked up from the same or a very near restaurant, ready within a few minutes of the first, and going the same way. Then bound the cost: the first customer's promise must still hold, and their extra minutes are capped.
    Follow-ups

    From the lesson Design food delivery like Swiggy

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  11. Mid to senior

    A busy restaurant's tablet goes offline during dinner with 12 orders in progress: some placed, some accepted, some being cooked. What happens to each order, and what do you change in the design?

    What it tests
    Failure handling of one party in a three-party state machine: detection, per-state behaviour, timers, honest communication, and keeping riders from wasting time.
    First step
    Separate the orders by state, because each state means a different promise. Placed orders have no commitment from the restaurant yet; accepted and cooking orders do, and the kitchen is probably still working even though its tablet is silent. Detect the outage from missed heartbeats first.
    Follow-ups

    From the lesson Design food delivery like Swiggy

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  12. Senior to staff

    Your routing service answers routes in under a millisecond with contraction hierarchies built every night from usual speeds. Product now wants routes and arrival times to follow live traffic, with speeds changing every minute. What breaks, and how do you change the design?

    What it tests
    Why preprocessed shortcuts go stale, trading query speed against update speed, cell overlays that are customised per cell, and staging the change safely.
    First step
    Say what a shortcut encodes: the fastest time across a run of junctions under last night's speeds. A jam on one arterial makes every shortcut over it wrong, so either the structure is rebuilt often, or it is replaced by one whose update cost fits a minute of speed changes.
    Follow-ups

    From the lesson Design maps, routing and ETA

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  13. Mid to senior

    In one city, evening arrival times are 5 to 10 minutes too optimistic on most trips, although the routes look right and the traffic layer shows the jams. How do you find the cause, and what do you change?

    What it tests
    Measuring arrival-time error by its sign and by bucket, separating segment speeds from junction waits and time of day, and fixing bias with history, corrections and re-estimation.
    First step
    Measure before guessing: compare predicted and actual times of finished trips in that city, split by departure time, trip length and road type, and look at the signed error rather than the absolute one. A steady lean in one direction points to something every trip shares, such as junction waits or speeds frozen at departure.
    Follow-ups

    From the lesson Design maps, routing and ETA

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  14. Mid to senior

    A new map build is published every night. For an hour after each release, tile latency doubles and the load on the tile origin rises tenfold. Explain why, and design a release that avoids it.

    What it tests
    Cache keys for tiles, why a version for the whole set empties every edge, new addresses only for changed tiles, long immutable lifetimes, and the index that maps tiles to addresses.
    First step
    Compare tile addresses before and after a release. If every address carries the build's version, every tile is new to every edge after the release, and all requests miss until the caches refill. Then count how many tiles actually changed: usually a small share.
    Follow-ups

    From the lesson Design maps, routing and ETA

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  15. Mid to senior

    An athlete records a morning run on a watch and on a phone app at the same time, and both upload. Another athlete's app retries one upload three times after timeouts. Design how the service recognises each case and what it does with each.

    What it tests
    Idempotent upload APIs, content hashes against keys built from what the data means, overlapping time ranges, and choosing to flag rather than delete when a rule can be wrong.
    First step
    Separate the cases by what is the same. A retry sends identical bytes, while two devices send different bytes for overlapping times. Hash the bytes at the API so that retries are harmless, and compare time ranges per athlete to find two recordings of one workout.
    Follow-ups

    From the lesson Design activity tracking like Strava: GPS ingestion

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  16. Fresher to mid

    Runners in a city centre report that their 10 km runs show as 11 to 14 km, while runs in parks are right. What is happening, and how do you fix the distance without breaking the parks?

    What it tests
    How GPS error inflates a distance summed from fixes near buildings, filtering jumps by speed, smoothing without crossing gaps, and testing changes against tracks of known length.
    First step
    Look at the raw fixes of a bad run on a map. Near tall buildings, reflected signals make fixes jump tens of metres and back, and each jump adds two long legs. Summing straight lines between noisy fixes overestimates the distance, and the city centre has more and bigger errors than a park.
    Follow-ups

    From the lesson Design activity tracking like Strava: GPS ingestion

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 2 minutes
  17. Senior to staff

    A security researcher shows that, from a user's public runs, they can find the user's home to within a few metres, although the user hid 200 m around it. Explain how, and redesign the privacy feature.

    What it tests
    Inference from repeated releases, random trimming and moved centres, applying privacy to every derived product, and reprocessing an athlete's history.
    First step
    Every visible track starts where it leaves the same 200 m circle, so the starts of several runs lie on one circle whose centre is the home. Fitting a circle through the starts of a few runs recovers it, so the fix must stop the starts from outlining one fixed circle.
    Follow-ups

    From the lesson Design activity tracking like Strava: GPS ingestion

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  18. Senior to staff

    An athlete switches an activity to private and back to public within ten seconds. An hour later their effort is still missing from the segment's leaderboard, although the activity is public. How can that happen, and how do you design the board updates so that it cannot?

    What it tests
    Ordering of changes per key, at-least-once delivery, idempotent consumers that re-read the source of truth, the order of commit and publish, and partition keys.
    First step
    Write down the sequence: add, remove, add. If the two last messages swap places on the way, or the remove is delivered again after the second add, an updater that applies message contents ends with the effort removed. Ask what the updater trusts: the message, or the stored effort.
    Follow-ups

    From the lesson Design activity tracking: segments and leaderboards

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  19. Mid to senior

    Cyclists complain that rides on a highway are credited with a segment on the service road beside it, 25 m away. Others say their rides on the service road are not matched at all. How do you fix both without breaking matching elsewhere?

    What it tests
    The corridor trade-off between precision and recall, measuring both on labelled tracks, extra signals such as heading and speed, and guidance for where segments start and end.
    First step
    Name the setting that trades the two complaints: the corridor around the segment. Wider than the gap between the roads, it matches both; much narrower than the GPS error, it misses genuine rides. Measure precision and recall on labelled tracks before changing it.
    Follow-ups

    From the lesson Design activity tracking: segments and leaderboards

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  20. Senior to staff

    A popular climb has 500,000 athletes on its leaderboard. The page must show the top 10 and the viewer's own rank within 200 ms, and boards are stored on disk, not in memory. Design the queries and the data, with numbers.

    What it tests
    Range reads for the top, why rank is a counting problem, stored rank checkpoints and their upkeep, caching, and when an in-memory sorted set is worth its cost.
    First step
    Split the two reads. The top 10 is a range read of the first rows in time order, cheap and cacheable. The rank is the number of faster athletes, which a time-ordered table can only count, about 250,000 rows for a median athlete, so the design must bound that count.
    Follow-ups

    From the lesson Design activity tracking: segments and leaderboards

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes

All System Design (High-Level Design) interview questions · The System Design (High-Level Design) track

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.