Design a driver leaderboard based on reviews
I was asked this
No reports yet. Sign in to say where you were asked it.
A system design interview question asked in Uber's system design round, last asked Jun 2026. It tests leaderboards, ranking and aggregation.
Riders review drivers after each trip with a star rating and optional text. Design a service that turns those reviews into a ranking of drivers and serves a top-drivers leaderboard. Start from the requirements and APIs, then cover the data model, how ratings are aggregated as reviews arrive, consistency, scale, recovery from failures and monitoring.
Requirements
- Functional: accept a review for a completed trip, at most one per trip.
- Functional: read the top N drivers for a scope (for example a city and a week) and a single driver's rank and score.
- Non-functional: reviews arrive continuously at high volume; leaderboard reads are frequent and must be fast; a new review may take a short time to show; scores must be recoverable if the service loses its state.
Clarifying questions
- What is the scope of a board: global, per city, per vehicle type? A fixed period or all time?
- How should a driver with three five-star reviews rank against one with a thousand reviews averaging 4.9?
- Can reviews be edited, deleted or removed as abuse? Do old reviews count less?
- How fresh must the board be, and who reads it: drivers, riders, internal teams?
- How many drivers and reviews per day?
What a strong answer covers
- APIs:
POST /reviews,GET /leaderboard?scope=…&limit=N,GET /drivers/{id}/rank, with idempotency on the trip id. - A score that is fair to drivers with few reviews: a minimum review count, a Bayesian average or a lower confidence bound, decided and justified.
- The pipeline: reviews stored durably, then a stream consumer updates per-driver aggregates (sum, count) and the ranked structure, such as a sorted set per scope.
- Scale: sharding sorted sets by scope, caching the top N, handling the many scopes a driver belongs to.
- Correctness and recovery: rebuild aggregates from the review log, handle duplicate and out-of-order events, apply edits and deletions as deltas.
- Monitoring: consumer lag, freshness of each board, score distribution drift.
Follow-ups
- Reviews older than 90 days should stop counting. How do you expire them?
- A group of riders bombs a driver with fake one-star reviews. How do you detect and undo it?
- Show each driver their exact rank among 200,000 drivers in a city. What does that cost?
- Add a weekly board that resets every Monday without downtime.
Where it's asked
- Uber · System design · Last asked Jun 202660 min · Whiteboard and discussion
What it tests
leaderboards · ranking · aggregation
No official answer yet. Draw yours on the right; publish it and it shows under Community.
Nothing published yet. Publish your canvas and it shows here for others to open and remix.
