FastPrepSummarize Taxi Drivers and Rides

Summarize Taxi Drivers and Rides

Boston Consulting Group logoBoston Consulting Group● EasyFULLTIMEINTERNOA

Problem statement

Analyze the provided taxi-driver and ride data, compute summary statistics, and save the result.

FastPrep practice interpretation

For this exercise, assume the input contains one drivers table and four ride partitions named rides_1 through rides_4. Return a one-row summary with exactly these columns:

  • average_rating: the arithmetic mean of rating across all drivers.
  • second_language_ratio: the number of drivers whose second_language is not exactly "no", divided by the total number of drivers.
  • successful_ride_ratio: the number of rides whose status is exactly "Success", divided by the number of rides across all four partitions.

Return the columns in the listed order; the returned table is the runnable practice equivalent of the source-reported saved result file.

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 used for the driver-level summary.

ColumnTypeNullableDescription
driver_idPKIntegerNo—
ageIntegerNo—
second_languageTextNo—
ratingDecimalNo—

rides_1

Ride partition 1.

ColumnTypeNullableDescription
ride_idPKIntegerNo—
driver_idIntegerNo—
statusTextNo—

Foreign key: driver_id → drivers(driver_id)

rides_2

Ride partition 2.

ColumnTypeNullableDescription
ride_idPKIntegerNo—
driver_idIntegerNo—
statusTextNo—

Foreign key: driver_id → drivers(driver_id)

rides_3

Ride partition 3.

ColumnTypeNullableDescription
ride_idPKIntegerNo—
driver_idIntegerNo—
statusTextNo—

Foreign key: driver_id → drivers(driver_id)

rides_4

Ride partition 4.

ColumnTypeNullableDescription
ride_idPKIntegerNo—
driver_idIntegerNo—
statusTextNo—

Foreign key: driver_id → drivers(driver_id)

Expected result

Your query or function must return these columns.

ColumnTypeNullableDescription
average_ratingDecimalNo—
second_language_ratioDecimalNo—
successful_ride_ratioDecimalNo—

Row order: must match exactly. Numeric tolerance: 1e-9.

Constraints

  • drivers contains at least one row.
  • At least one ride exists across rides_1, rides_2, rides_3, and rides_4.
  • Every ride references a driver present in drivers.
  • Each rating is finite.
  • Ratios are values between 0 and 1, inclusive.

More Boston Consulting Group problems

See Boston Consulting Group hiring insights