FastPrepAnalyze Taxi Driver and Ride Metrics
Problem · Database

Analyze Taxi Driver and Ride Metrics

EasyTiktok logoTiktokNEW GRADOA
See Tiktok hiring insights

Problem statement

You are given one table of taxi drivers and four partitions of ride data. Produce three summary metrics over the complete data set.

  1. Return the average value of drivers.rating with insight_type equal to average_driver_rating.
  2. Return the percentage of drivers whose second_language is not exactly no with insight_type equal to percentage_drivers_with_second_language.
  3. Combine rides_1 through rides_4, then return the percentage of rides whose status is exactly Success with insight_type equal to ride_success_rate.

Return a two-column table named by the result contract. Each row corresponds to one task above, in the same order.

Table schema

Pandas

Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.

drivers

Taxi-driver attributes from drivers.csv.

ColumnTypeNullableDescription
driver_idPKIntegerNoUnique driver identifier.
ageIntegerNoDriver age.
second_languageTextNoThe driver's second language, or the exact value no.
ratingDecimalNoAverage driver rating.

rides_1

First partition of rides_1.csv through rides_4.csv.

ColumnTypeNullableDescription
ride_idPKIntegerNo
driver_idIntegerNo
passenger_idIntegerNo
dateTextNo
statusTextNo

Foreign key: driver_id drivers(driver_id)

rides_2

Second partition of rides_1.csv through rides_4.csv.

ColumnTypeNullableDescription
ride_idPKIntegerNo
driver_idIntegerNo
passenger_idIntegerNo
dateTextNo
statusTextNo

Foreign key: driver_id drivers(driver_id)

rides_3

Third partition of rides_1.csv through rides_4.csv.

ColumnTypeNullableDescription
ride_idPKIntegerNo
driver_idIntegerNo
passenger_idIntegerNo
dateTextNo
statusTextNo

Foreign key: driver_id drivers(driver_id)

rides_4

Fourth partition of rides_1.csv through rides_4.csv.

ColumnTypeNullableDescription
ride_idPKIntegerNo
driver_idIntegerNo
passenger_idIntegerNo
dateTextNo
statusTextNo

Foreign key: driver_id drivers(driver_id)

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
insight_typeTextNo
valueDecimalNo

Row order: must match exactly. Numeric tolerance: 0.01.

Constraints

  • There is at least one driver and at least one ride across the four ride partitions.
  • driver_id and ride_id values are unique identifiers in their source files.
  • Every ride references a driver in drivers.
  • second_language uses the exact value no when a driver has no second language.
  • status is one of Rejected by the driver, Cancelled by the passenger, or Success.
  • Percentages use the 0-to-100 scale. Numeric results are accepted within 0.01 of the expected value.

Source note: The screenshots are shown in source order. FastPrep cropped unrelated source-page chrome and added its watermark without covering task content.

More Tiktok problems