Round 1
Questions: Implement 3 APIs for a delivery system app. The delivery driver has an hourly rate for performing delivery. Implement the following three APIs:
addDriver(driverId(integer), hourlyRate(float))
addOrder(driverId, startTime, endTime)
: mention the choice of datatype you choose for time and whygetTotalCost
for all the deliveries.
Follow-up Questions:
- What is the issue with using float and double as data type for currency and what data type should you use?
- What changes would you make in the code if we want to update the hourly rate of a driver?
Candidate's Approach
The candidate felt optimistic about this round, as they were able to write production-level code, handling concurrency and other best practices, and answer the follow-up questions.
Interviewer's Feedback
The candidate received feedback from the recruiter stating that they could solve only 1 question out of 3. The other 2 questions required at least a discussion of the approach. The candidate mentioned that they had asked the interviewer about the time and number of questions remaining, but felt that the interviewer did not set the correct expectations, which affected their execution.