Design a delivery cost aggregator
Company: Rippling
Role: Software Engineer
Category: System Design
Difficulty: medium
Interview Round: Technical Screen
Design and implement an in-memory component for a food-delivery company that tracks driver payments and exposes one metric: the total cost of all deliveries. Provide these APIs: addDriver(driverId:int, usdHourlyRate:double), recordDelivery(driverId:int, startTime, endTime), and getTotalCost():double. Requirements: drivers have different hourly rates; drivers may have overlapping deliveries and are paid for each independently; each delivery is recorded immediately after completion and lasts no more than 3 hours; times require at least one-second precision—discuss and choose a time representation; getTotalCost returns the aggregated cost across all drivers for use on a live dashboard; all inputs are valid and exact output formatting is not required.
Quick Answer: This question evaluates skills in designing a concurrent in-memory aggregation component, including system design, thread-safety, time and currency precision, and live-metrics computation.