Skip to main content
All Questions

Simulate a round-robin load balancer that assigns requests to the lowest free server.

Unlock detailed company stats for this questionUpgrade

Implement a prototype round-robin load-balancing algorithm for n servers numbered 1 to n handling m requests. Each request i arrives at arrival[i] and takes burstTime[i]. The balancer assigns request i to the available server with the lowest index. A server is busy from assignment until arrival[i] + burstTime[i]. If no server is available at arrival[i], the request is dropped and marked -1.

Similar to LeetCode 1606 (Find Servers That Handled Most Number of Requests) but with allocation to the globally lowest-index available server rather than circular offsets.

Community answers

No answers contributed by the community yet.

Related courses

Course

Software Engineering Interview Prep

Land your dream software engineering role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates—practice data structures, algorithms, system design, people management, behavioral interviews, and more.

Course

System Design Interviews

Learn how to answer the latest system design questions across product, infrastructure, and AI domains. Features in-depth video examples, written breakdowns, and helpful reference patterns. Watch senior engineers and managers answer these questions in mock interview videos.