This was the first technical interview after HR screen. The interviewer asked me do I want to use AI or not, and said if I picked AI I would get a harder question. I chose not to use AI and this was the question I needed to solve in 45 minutes:
Design a delivery-driver payment system
add_driver(driver_id, usd_hourly_rate)— register a driver with an hourly rate.record_delivery(driver_id, start_time, end_time)— log a completed delivery work interval for a driver.get_total_cost()— return the total accrued labor cost across all drivers and all recorded deliveries, independent of what has been paid.pay_up_to(pay_time)— settle / mark wages as paid for all work performed up to the given timestamp. Calling it repeatedly with the same (or an earlier) time must not double-pay.get_total_cost_unpaid()— return the total unsettled wages remaining after payouts.
Discussion
Loading comments…