DoorDash interview question

Basic data structure