← Questions
Assign tasks to servers by weighted load with expiry
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Servers each have a maximum load. Tasks arrive in time order, each with a weight and a time to live. Before placing a task, release every earlier task whose time has run out. Place the task on the server with the smallest current load that can still fit its weight, breaking ties by server name, and report where each task went, or that no server could take it. Discuss how a heap of expiry times keeps this efficient.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
