DoorDash interview question

Data Structures and algorithm mostly