Object-Oriented Programming · DoorDash · Hard
Build a load balancer whose pool of backend servers can grow and shrink over time, and which can route requests in two ways: by round-robin and by consistent hashing. The pool starts out empty. Each server is identified by an ASCII string that contains no spaces. The program reads an integer Q on its first line, giving the number of operations, followed by Q lines, each holding one operation from the table below: Operation Effect Printed result ADD server Inserts a server…