D.E. Shaw | Online Assessment | 14 July 2024 | Server Task Assignment | Complete Solution

deshaw · Question · Posted Apr 2026

Given that there are n servers, and their start and end times are given in starts and ends arrays where the ith server is online during the semi-closed interval [starts[i], ends[i]) i.e. it starts at starts[i] and stops just before ends[i]. The k tasks are given in the tasks array. For each task, find the minimum waiting time for assignment to a server. If it is not possible to assign the ith task to any of the servers, return -1 ...

The full answer & interview discussion are available to premium members.

Log in Create a free account