Delivery Ledger is a small codebase that tracks how much a courier company owes its drivers. Drivers log their deliveries, their hourly rates can change over time, and payroll processes payments up to a specified point in time.
The interview lasts 60 minutes and is divided into four phases:
pay_up_to(time) and unpaid() while following five payment rules defined in the README.total_cost() and unpaid() after almost every event, with tests scaling to 2,000 drivers and 400,000 requests (6,000 drivers and 1,000,000 requests in Java, C# and C++).Phases 1 and 2 require relatively little code, but the challenge is handling several payment rules correctly at the same time. Time intervals are half-open, overlapping deliveries must be paid only once, rounding happens once per driver, and a payment can cover part of a delivery.
The tricky part is that most incorrect implementations in this exercise still pass all the visible tests while breaking one of these rules. Hidden tests check each rule separately, so work out the edge cases before prompting the assistant, and always test the generated code before moving on.