My coding interview used HackerRank, allowed AI assistance, and provided no starter template. The task was to build classes and functions for delivery-driver rates, delivery records, and cost calculations using Python, Unix timestamps, and dictionaries.
The requirements included updating rates with effective timestamps and accounting for how those changes affected delivery costs. I was expected to write tests and check correctness, as well as support historical-rate queries.
Follow-ups covered monetary precision: why using floating-point values and rounding to two decimal places was insufficient, and how to handle amounts correctly. Another asked to improve total-cost queries from linear to constant time.
Discussion
Loading comments…