SQL interview questions · By company
Uber SQL interview questions
For data analyst and data scientist roles: what candidates report, and how to practice for it.
SQLRep isn't affiliated with or endorsed by Uber. This guide summarizes public candidate reports and prep guides (sources below, checked November 2026). The practice questions are original, written in the reported style; they aren't Uber's actual questions. Processes change, so confirm details with your recruiter.
What candidates report about the process
- Reports describe SQL screening plus product and business rounds.
- Most public question lists are compiled by prep sites rather than first-hand reports.
SQL topics that come up
- Each user's latest or Nth trip (ROW_NUMBER)
- Rates split by group: cancellations, acceptance, surge
- Aggregating two fact tables without fan-out
Practice the reported patterns
Each one runs in real PostgreSQL in your browser, with feedback on what's wrong.
- Each rider's third completed tripFor every rider with at least three completed trips, return rider (the rider's name), trip_id, requested_at and city of their third completed trip, counting in requested_at order. Sort by rider.Pattern: ROW_NUMBER · filter before numberingEasyPro
- Each rider's latest completed tripFor every rider with at least one row in rt_trips, return rider (name), last_trip_at (requested_at of their latest completed trip) and last_city (that same trip's city). Both are NULL if the rider has no completed trip. Sort by rider.Pattern: DISTINCT ON · LEFT JOIN · the MAX(city) trapMediumPro
- Cancellation rate by who cancelled, banned users excludedLeaving out every trip whose rider or driver is banned, return city, trips, rider_cancel_pct (status 'cancelled_by_rider' as a % of trips) and driver_cancel_pct (status 'cancelled_by_driver' as a % of trips), both rounded to 1 decimal. Trips with no driver count normally. Sort by city.Pattern: One table joined twice · NULL foreign keys · FILTERHardPro
- Driver earnings per online hour, by weekFor every driver and week (Monday start) with at least one session in rt_driver_sessions, return driver (name), week_start (a date), online_hours (total session hours, rounded to 2), earnings (sum of driver_payout from that week's completed trips, 0 if none) and earnings_per_hour (earnings divided by the unrounded hours, rounded to 2). Sort by week_start, then driver.Pattern: Aggregate each fact table separately · join on driver and week · COALESCEHardPro
- Share of trips with surge pricingFor completed trips only, return city, completed_trips, surge_trips (completed trips with surge_multiplier above 1.00) and surge_pct (surge_trips as a percentage of completed_trips, ROUND(..., 1)). A NULL surge_multiplier means no surge was applied. Sort by surge_pct highest first, then city.Pattern: COUNT(*) FILTER · share of a groupEasyPro
- Driver acceptance rateReturn driver_id, city, offers (every offer sent to the driver), accepted, and acceptance_pct (accepted as a percentage of offers, ROUND(..., 1)). A NULL response means the offer timed out, which counts as an offer that wasn't accepted. Sort by acceptance_pct highest first, then driver_id.Pattern: COUNT(*) vs COUNT(column) · NULL in the denominatorEasyPro
- Cancellation rate by hour of dayUsing every trip request in mkt_trips, return hour (the hour of day of requested_at, 0-23, as an integer), requests, cancellations (trips cancelled by the rider or by the driver) and cancel_pct (cancellations as a percentage of requests, ROUND(..., 1)). One row per hour that has requests, sorted by hour.Pattern: EXTRACT(HOUR) · conditional COUNTMediumPro
- Each customer's first orderReturn customer_id, order_id, order_date, amount and status of each customer's earliest order (any status). Sort by customer_id.Pattern: DISTINCT ON · first row per groupMediumPro
- Largest charge per accountReturn account_id, id, merchant, amount and txn_date of each account's largest transaction, exactly one row per account. If amounts tie, keep the one with the higher id. Sort by account_id.Pattern: ROW_NUMBER() · deterministic tie-breakerMediumPro
- Courier earnings per hour onlineFor every courier with at least one session in fd_courier_sessions, return courier (name), jobs (rows in fd_courier_jobs, 0 if none), hours_online (total session hours, ROUND(..., 2)), earnings (sum of fee + tip, a missing tip counting as 0; 0 if no jobs) and earnings_per_hour (earnings divided by the unrounded hours, ROUND(..., 2)). Sort by earnings_per_hour descending, then courier.Pattern: Aggregate before joining · fan-out · COALESCEHardPro
Tip: Trip data has many statuses: always state which ones count before you compute a rate.
Sources
Uber is a trademark of its owner, used here only to identify the company the reports are about.