System Design · Scale AI · Hard
You are designing a lightweight load balancer for a Python-based backend service that dispatches tasks to a pool of worker processes. Describe how you would design it to meet the following requirements. 1. Worker state machine Each worker can be in states such as IDLE, BUSY, FAILED, DRAINING, and so on. The load balancer must track each worker's state and assign new tasks only to eligible workers. State transitions must be well defined (for example IDLE -> BUSY -> IDLE, BUSY…
Checking your access…