Katkat

Maximize Non-Overlapping Task Scheduling Efficiency

PinterestData Scientist · Onsite

Last updated

This question evaluates understanding of interval scheduling and resource optimization, focusing on reasoning about time intervals and conflict-free selection of tasks.

Scenario

Job scheduler on a single machine wants to maximise throughput.

Question

Given tasks with [start, end) times, return the maximum number of non-overlapping tasks that can be scheduled. Example: [[1,3],[1,5],[4,6]] ➝ 2.

Hints

Sort by end time and greedily pick compatible intervals.