The Traffic Director
A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- easy
- Seniority
- L4
Problem
Given a list of server names and a list of requests, assign requests to servers in round-robin order (request i goes to servers[i % len(servers)]). Return a dict mapping each request to its assigned server.
Summary
Spread the load evenly - nobody should be doing all the work.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.