Delivery Dashboard System
Design a delivery tracking system for a food delivery company that manages driver payment rates and records delivery costs based on time spent. Implement an API to add drivers with hourly rates, record deliveries with start and end times, and calculate the total aggregated cost of all deliveries.
Asked at:
Rippling
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Late May, 2026
Rippling
Mid-level
Food delivery companies employ tens of thousands of delivery drivers who each submit hundreds of deliveries per week. Delivery details are automatically sent to the system immediately after the delivery. Delivery drivers have different hourly payment rates, depending on their performance. Drivers can take on, and be paid for, multiple deliveries simultaneously. If a driver is paid $10.00 per hour, and a delivery takes 1 hour and 30 minutes, the driver is paid $15.00 for that delivery. We are building a dashboard to show a single number - the total cost of all deliveries - on screens in the accounting department offices. Implement the following API: addDriver(driverId [integer], usdHourlyRate [float]): The given driver will not already be in the system. recordDelivery(driverId [integer], startTime, endTime): Discuss the time format you choose. Times require minimum one-second precision. All deliveries will be recorded immediately after the delivery is completed. No delivery will exceed 3 hours. getTotalCost(): Return the total, aggregated cost of all drivers' deliveries recorded in the system. This will be used for a live dashboard. Do not worry about exact formatting. All inputs will be valid. pay_upto(seconds) get_total_unpaid() Constraints: We want to see good OOP practices. The solution does not need to be thread-safe or handle concurrency.
Your account is free and you can post anonymously if you choose.