Company: Rippling
Difficulty: medium
Food delivery companies employ tens of thousands of delivery drivers who each submit hundreds of deliveries per week. Delivery details are sent to the system immediately after the delivery completes. Delivery drivers have different hourly payment rates depending on their performance, and a driver 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. You are building the accounting dashboard behind this. Process a stream of commands and answer the cost queries. Commands ADD_DRIVER <driverId> <usdHourlyRate> - register a driver. The driver is not already in the system. usdHourlyRate is a decimal amount with exactly two digits after the decimal point. RECORD_DELIVERY <driverId> <startTime> <endTime> - record a completed delivery. Times are integer epoch seconds with startTime <= endTime . The driver is already in the syst