DoorDash interview question

dasher quesition to implement and optimaize