You operate a cluster of identical servers that run recurring daily jobs.
For a single day, you are given a list of job execution intervals. Each interval has:
job_id
(string or integer),
start_time
(timestamp within that day),
end_time
(timestamp within that day), with
start_time < end_time
.
Interpret each interval as a half-open time range [start_time, end_time) during which that job must be running on some server on that day.
Rules and constraints:
job_id
, they may overlap in time
on the same server
(they are considered parts or retries of the same job and do not consume extra capacity).
job_id
s and overlapping intervals), compute the
minimum number of servers
required to schedule all the jobs under the above rules.
Some rare jobs are extremely long-running and conceptually span multiple days without restart. For such a multi-day job, you decide to reserve a dedicated server that is not shared with any other jobs, but which may still handle different intervals of that same job_id.
Explain how you would extend or adapt your solution to: