Skip to content
SQL interview questions

RideGo

Ride-hailing

RideGo is an app-based ride-hailing platform operating in Indian metros and tier-2 cities. Riders book cabs, autos and bikes; drivers come online with their own vehicles and earn per trip. The data mixes trip events (request, pickup, drop-off), money (fares, payments, driver payouts) and time and place (cities, timestamps, location pings), which is exactly what ride-hailing and delivery companies test in their SQL rounds.

See the RideGo tables

RideGo schema

All tables live in the ridego schema, so write ridego.riders in your queries.

ridego.riders

One row per rider (customer).

  • rider_id (INT) — PK
  • first_name (VARCHAR(50))
  • last_name (VARCHAR(50))
  • email (VARCHAR(120))
  • phone (VARCHAR(15))
  • signup_date (TIMESTAMP)
  • city (VARCHAR(40)) — home city at signup
  • rating (DECIMAL(2,1)) — average rating given by drivers, 1 to 5

ridego.drivers

One row per driver.

  • driver_id (INT) — PK
  • first_name (VARCHAR(50))
  • last_name (VARCHAR(50))
  • email (VARCHAR(120))
  • vehicle_type (VARCHAR(20)) — 'sedan', 'hatchback', 'suv', 'auto', 'motorbike'
  • vehicle_number (VARCHAR(20))
  • signup_date (TIMESTAMP)
  • status (VARCHAR(20)) — 'active', 'deactivated', 'pending'
  • city (VARCHAR(40)) — primary operating city
  • rating (DECIMAL(2,1)) — average rating from riders, 1 to 5

ridego.trips

One row per ride request, whether or not it was completed.

  • trip_id (INT) — PK
  • rider_id (INT) — FK → riders.rider_id
  • driver_id (INT) — FK → drivers.driver_id; nullable; NULL when no driver accepted
  • request_time (TIMESTAMP)
  • pickup_time (TIMESTAMP) — nullable; NULL if the trip never started
  • dropoff_time (TIMESTAMP) — nullable; NULL unless completed
  • pickup_city (VARCHAR(40))
  • dropoff_city (VARCHAR(40))
  • distance_km (DECIMAL(6,1))
  • status (VARCHAR(20)) — 'completed', 'rider_cancelled', 'driver_cancelled', 'no_driver', 'system_cancelled'
  • fare_amount (DECIMAL(10,2)) — nullable; fare charged to the rider; NULL unless completed
  • surge_multiplier (DECIMAL(3,1)) — 1.0 means no surge

ridego.payments

Payment attempts. A completed trip can have a failed attempt followed by a successful one.

  • payment_id (INT) — PK
  • trip_id (INT) — FK → trips.trip_id
  • amount (DECIMAL(10,2))
  • payment_method (VARCHAR(20)) — 'card', 'upi', 'wallet', 'cash_recorded'
  • payment_status (VARCHAR(20)) — 'success', 'failed', 'refunded'
  • created_at (TIMESTAMP)

ridego.driver_earnings

One row per completed trip: what the driver earned.

  • earning_id (INT) — PK
  • driver_id (INT) — FK → drivers.driver_id
  • trip_id (INT) — FK → trips.trip_id
  • base_fare (DECIMAL(10,2))
  • distance_fare (DECIMAL(10,2))
  • surge_earnings (DECIMAL(10,2))
  • commission_amount (DECIMAL(10,2)) — platform commission
  • payout_amount (DECIMAL(10,2)) — amount paid to the driver
  • payout_date (DATE)

ridego.driver_locations

Periodic GPS pings from online drivers. High volume; usually aggregated by city and time bucket.

  • ping_id (BIGINT) — PK
  • driver_id (INT) — FK → drivers.driver_id
  • recorded_at (TIMESTAMP)
  • latitude (DECIMAL(9,6))
  • longitude (DECIMAL(9,6))
  • city (VARCHAR(40))

Beginner (13)

  • BeginnerThe first 20 riders to sign upOpen now
  • BeginnerDistinct rider citiesOpen now
  • BeginnerHow many drivers?
  • BeginnerActive drivers in Bengaluru
  • BeginnerCompleted trips for one rider
  • BeginnerCompleted trips with surge pricing
  • BeginnerDrivers who joined last calendar year
  • BeginnerTrips per status
  • BeginnerTop 10 most expensive completed trips
  • BeginnerFailed payment attempts
  • BeginnerDrivers by vehicle type
  • BeginnerAverage distance of completed trips
  • BeginnerRiders who never requested a trip

Intermediate (15)

  • IntermediateTotal revenue from completed trips
  • IntermediateRiders with more than 5 completed trips
  • IntermediateDrivers with at least 50 completed trips
  • IntermediateTotal payout per driver
  • IntermediateTop 10 earning drivers last calendar year
  • IntermediateCancellation rate by pickup city
  • IntermediateAverage surge multiplier by city
  • IntermediatePayment success rate by method
  • IntermediateTrips with a long wait for pickup
  • IntermediateRequests by hour of day
  • IntermediateCompleted trips with no successful payment
  • IntermediateDrivers online in the last 24 hours, by city
  • IntermediatePlatform commission by city
  • IntermediateCOUNT star versus COUNT nullable driver
  • IntermediateRiders using card or UPI, without double counting

Advanced (21)

  • AdvancedRank riders by total spend
  • AdvancedRank drivers by rating within their city
  • AdvancedMonthly revenue and month-over-month growth
  • Advanced7-day rolling average of daily requests
  • AdvancedDrivers with a high cancellation rate
  • AdvancedTop-earning drivers with low ratings
  • AdvancedRiders who return within 14 days
  • AdvancedRFM metrics for riders
  • AdvancedDrivers who stopped driving (90 days)
  • AdvancedCompleted trips where payments don't match the fare
  • AdvancedDriver online sessions from location pings
  • AdvancedCity and request-status subtotals
  • AdvancedRequest-to-pickup funnel at rider grain
  • AdvancedPickup wait median and p95 by city
  • AdvancedLatest two location observations per driver
  • AdvancedConvert UTC requests to India business dates
  • AdvancedOverall versus average driver cancellation rate
  • AdvancedComplete pickup-wait histogram
  • AdvancedTrip facts and payment-attempt grain
  • AdvancedTrue last trip versus LAST_VALUE's default frame
  • AdvancedA parameterized SQL function for completed-trip counts

Mock interview round (5)

  • AdvancedMock round 1: Revenue in the last 6 months
  • AdvancedMock round 2: New vs returning riders (last 30 days)
  • AdvancedMock round 3: Peak-hour surge by city
  • AdvancedMock round 4: Driver reliability by city
  • AdvancedMock round 5: City summary for the board

Choose optional cookies

We use necessary cookies for account security. With your permission, we also use analytics and advertising cookies on marketing pages. See our Privacy Policy.

RideGo SQL Interview Questions | TechNet Consultancy