Practice Interview Questions
| Question | Status |
|---|---|
Uber has a database table called trips that stores information about each trip taken by customers. You've been asked to find the top 3 drivers with the highest revenue. Assume that Uber takes a 20% cut on each trip. Round your results to 0 decimals.
For this interview question, assume there are no ties in drivers' revenue.
trips table:
| Column Name | Description |
|---|---|
| trip_id | Unique identifier for each trip |
| customer_id | Identifier of the rider |
| driver_id | Identifier of the driver |
| start_time | Start time of the trip. |
| end_time | End time of the trip |
| distance | Distance covered |
| cost | Total cost of the trip |
| driver_id | total_revenue |
|---|---|
| 123456 | 1250 |
| 123457 | 1000 |
| 123458 | 950 |
Uber has a database table called trips that stores information about each trip taken by customers. You've been asked to find the top 3 drivers with the highest revenue. Assume that Uber takes a 20% cut on each trip. Round your results to 0 decimals.
For this interview question, assume there are no ties in drivers' revenue.
trips table:
| Column Name | Description |
|---|---|
| trip_id | Unique identifier for each trip |
| customer_id | Identifier of the rider |
| driver_id | Identifier of the driver |
| start_time | Start time of the trip. |
| end_time |
| End time of the trip |
| distance | Distance covered |
| cost | Total cost of the trip |
| driver_id | total_revenue |
|---|---|
| 123456 | 1250 |
| 123457 | 1000 |
| 123458 | 950 |