Design a load balancer for 10 servers and write corresponding test cases
Asked in the coding round stage. Production-ready code expected.
Implement route_requests(requests, healthy_servers). The input contains request identifiers and a Boolean list of exactly 10 servers, where index i identifies server i. Route requests in round-robin order across healthy servers only. Return a list containing the selected server index for each request, or -1 when no server is healthy. The first request starts at server 0; after reaching server 9, scheduling wraps to server 0.
def route_requests(requests, healthy_servers):