Back to problems

Pick Dasher / Round Robin Load Balancer

Object-Oriented Programming · DoorDash · Medium

Requirements Input: a pre-written class—possibly called LoadBalancer, DasherPicker, or DasherMap—that exposes pick(), add(), remove(), and an adjustKey() helper. The class is supposed to assign incoming orders to one of N dashers in round-robin fashion. Task 1: identify and correct the defects. The interviewer may inject different bugs, including: A constructor that is absent or ordered incorrectly, so member fields are accessed before setup is complete. An adjustKey()…

Checking your access…