[USA] DoorDash Code Craft Round
Summary
I successfully navigated the Code Craft round for a Midlevel SWE role at DoorDash, which focused on a collaborative problem to design and implement Dasher payout logic within a new Payments Service microservice. The experience was positive, and I passed the round.
Full Experience
I recently had my Codecraft round for a Midlevel SWE position at DoorDash. This wasn't a typical LeetCode-style problem; instead, it was a collaborative coding exercise with the interviewer. I found the discussion incredibly engaging, and the interviewer was genuinely present and interested in my thought process, which I really appreciated. I successfully passed this round.
Interview Questions (3)
As part of migrating from a monolith to a micro-service architecture, my team was tasked with building a new Payments Service, specifically the Dasher payout logic. My project involved creating an API with a POST /payout endpoint that takes dasherId as input and outputs the dollar amount the dasher gets paid. This endpoint needed to request delivery information from a separate upstream service (which could be mocked for the exercise).
The payment model's first version was based on the time a Dasher spends fulfilling each order. Given a sequence of order activities for a Dasher on a given day, I needed to calculate the pay based on these rules:
- Base pay rate: $0.3 per minute
- Multi-order pay rate: # ongoing deliveries * base pay rate
What would be the edge cases you can think of in your implementation of the Dasher payout logic? Discuss and correct for those, and test your code.
What would happen if the upstream service (for delivery information) had high latency? What would you do to mitigate this?