Topic
Greedy & Intervals interview problems
Scheduling, interval merging and exchange arguments. 181 original problems, each with hidden test cases you can run in the browser.
24 easy144 medium13 hard
Showing 151–180 of 181 results
Calculate the peak number of overlapping time intervals to determine minimum resource capacity.
Auto-gradedintervalssweep-linesortingTests greedy deadline scheduling for time-critical interception tasks and event grouping with gap-based sessionization.
Auto-gradedgreedysortingsimulationevent-processingTests binary-search-on-answer combined with a greedy interval feasibility check to solve the 1D k-center minimax placement problem.
Auto-gradedbinary-searchgreedysortingTests greedy interval scheduling with heap-based resource allocation to find the smallest number of rooms needed for overlapping meetings.
Auto-gradedintervalsheapgreedyschedulingTests the sweep-line technique by finding the maximum number of meeting rooms simultaneously occupied across a set of half-open booking intervals.
Auto-gradedgreedysweep lineintervalsTests the ability to merge overlapping intervals greedily to find the fewest horizontal paint strokes needed to fully cover a set of colored segments on a 1-D board.
Auto-gradedgreedyintervalssortingTests greedy scheduling with deadlines: select the maximum number of unit-length jobs, each with a profit and deadline, maximizing total profit within deadline slots.
Auto-gradedgreedyschedulingintervalssortingTests greedy iteration with adjacency rules, requiring precise edge-case handling and index management.
Auto-gradedgreedyarraysiterationTests interval merging to identify time windows where all participants are simultaneously unoccupied for a minimum duration.
Auto-gradedintervalsmergingschedulingTests whether candidates can apply a greedy scheduling-with-deadlines strategy to select and order tasks that maximize the count of on-time completions.
Auto-gradedgreedyintervalsschedulingFind the largest sum of k consecutive positions when values are defined by disjoint intervals on an infinite line.
Auto-gradedsliding-windowtwo-pointersintervalsmodular-arithmeticTests greedy selection within independent groups and optimal placement of a single unrestricted resource.
Auto-gradedgreedyhash-tablesortingSimulates executing a fixed sequence of jobs where re-running the same job requires waiting through a cooldown period.
Auto-gradedgreedyhash-mapsimulationTests two-pointer traversal on sorted interval lists to find all pairwise overlaps in linear time.
Auto-gradedintervalstwo-pointerssortingarraysTests interval merging, sorting, and boundary logic to identify all missing integer ranges within the overall coverage span.
Auto-gradedintervalssortingmergingrangesTests greedy selection by frequency: choose the fewest distinct values whose total occurrences cover at least half the array.
Auto-gradedgreedyhashingsortingTests greedy optimization when all items have uniform weight, requiring recognition that standard knapsack DP is unnecessary and handling large counts efficiently.
Auto-gradedgreedysortingoptimizationTests greedy selection and sorting to maximize items within a budget while minimizing cost for that maximum count.
Auto-gradedgreedysortingarraysTests interval merging with time zones, weekly recurrence, and range filtering to find deployable windows on a cyclic timeline.
Auto-gradedintervalsarraystime-zonesTests interval merging with half-open semantics, distinguishing overlap from adjacency, and handling nested ranges correctly.
Auto-gradedintervalssortinggreedyarray-manipulationTests ability to apply a sweep-line with a greedy exchange argument to optimally place point guards that each cover a fixed-radius interval on a 1-D gallery.
Auto-gradedgreedyintervalssweep lineTests the exchange-argument greedy technique by scheduling deadline-bearing tasks into time slots to minimize total weighted idle (missed-deadline) penalty.
Auto-gradedgreedyintervalsschedulingexchange argumentTests greedy scheduling with deadlines: select and order unit-length jobs to maximize total profit, applying an exchange argument to prove optimality.
Auto-gradedgreedyschedulingsortingTests the sweep line technique on interval scheduling to find the peak number of overlapping room bookings over a timeline.
Auto-gradedsweep lineintervalsgreedyTests the classic exchange-argument greedy insight: scheduling jobs by earliest deadline minimizes the maximum lateness over all jobs.
Auto-gradedgreedyintervalssortingexchange-argumentTests whether a candidate can apply an exchange-argument greedy to order tasks with deadlines and penalties to minimize total weighted lateness, with fixed unavailable time windows.
Auto-gradedgreedyintervalsschedulingexchange argumentTests the classic exchange-argument greedy insight that scheduling jobs by deadline minimizes total weighted lateness on a single machine.
Auto-gradedgreedyintervalsschedulingexchange-argumentTests ability to merge overlapping intervals and use a greedy sweep to find the maximum total length covered by selecting at most K non-overlapping merged segments.
Auto-gradedgreedyintervalssortingTests whether a candidate can apply an exchange-argument greedy to schedule the fewest rest-window insertions so every worker shift is covered without violating a maximum continuous-work limit.
Auto-gradedgreedyintervalsschedulingexchange argumentTests the ability to use a sweep line (difference array) to efficiently count how many time slots are simultaneously "active" and find the maximum overlap count.
Auto-gradedgreedyintervalssweep line