KatInterview

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.

Problems181

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-linesorting
  • Tests greedy deadline scheduling for time-critical interception tasks and event grouping with gap-based sessionization.

    Auto-gradedgreedysortingsimulationevent-processing
  • Tests binary-search-on-answer combined with a greedy interval feasibility check to solve the 1D k-center minimax placement problem.

    Auto-gradedbinary-searchgreedysorting
  • Tests greedy interval scheduling with heap-based resource allocation to find the smallest number of rooms needed for overlapping meetings.

    Auto-gradedintervalsheapgreedyscheduling
  • Tests the sweep-line technique by finding the maximum number of meeting rooms simultaneously occupied across a set of half-open booking intervals.

    Auto-gradedgreedysweep lineintervals
  • Tests 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-gradedgreedyintervalssorting
  • Tests 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-gradedgreedyschedulingintervalssorting
  • Tests greedy iteration with adjacency rules, requiring precise edge-case handling and index management.

    Auto-gradedgreedyarraysiteration
  • Tests interval merging to identify time windows where all participants are simultaneously unoccupied for a minimum duration.

    Auto-gradedintervalsmergingscheduling
  • Tests whether candidates can apply a greedy scheduling-with-deadlines strategy to select and order tasks that maximize the count of on-time completions.

    Auto-gradedgreedyintervalsscheduling
  • Find the largest sum of k consecutive positions when values are defined by disjoint intervals on an infinite line.

    Auto-gradedsliding-windowtwo-pointersintervalsmodular-arithmetic
  • Tests greedy selection within independent groups and optimal placement of a single unrestricted resource.

    Auto-gradedgreedyhash-tablesorting
  • Simulates executing a fixed sequence of jobs where re-running the same job requires waiting through a cooldown period.

    Auto-gradedgreedyhash-mapsimulation
  • Tests two-pointer traversal on sorted interval lists to find all pairwise overlaps in linear time.

    Auto-gradedintervalstwo-pointerssortingarrays
  • Tests interval merging, sorting, and boundary logic to identify all missing integer ranges within the overall coverage span.

    Auto-gradedintervalssortingmergingranges
  • Tests greedy selection by frequency: choose the fewest distinct values whose total occurrences cover at least half the array.

    Auto-gradedgreedyhashingsorting
  • Tests greedy optimization when all items have uniform weight, requiring recognition that standard knapsack DP is unnecessary and handling large counts efficiently.

    Auto-gradedgreedysortingoptimization
  • Tests greedy selection and sorting to maximize items within a budget while minimizing cost for that maximum count.

    Auto-gradedgreedysortingarrays
  • Tests interval merging with time zones, weekly recurrence, and range filtering to find deployable windows on a cyclic timeline.

    Auto-gradedintervalsarraystime-zones
  • Tests interval merging with half-open semantics, distinguishing overlap from adjacency, and handling nested ranges correctly.

    Auto-gradedintervalssortinggreedyarray-manipulation
  • Tests 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 line
  • Tests the exchange-argument greedy technique by scheduling deadline-bearing tasks into time slots to minimize total weighted idle (missed-deadline) penalty.

    Auto-gradedgreedyintervalsschedulingexchange argument
  • Tests greedy scheduling with deadlines: select and order unit-length jobs to maximize total profit, applying an exchange argument to prove optimality.

    Auto-gradedgreedyschedulingsorting
  • Tests the sweep line technique on interval scheduling to find the peak number of overlapping room bookings over a timeline.

    Auto-gradedsweep lineintervalsgreedy
  • Tests the classic exchange-argument greedy insight: scheduling jobs by earliest deadline minimizes the maximum lateness over all jobs.

    Auto-gradedgreedyintervalssortingexchange-argument
  • Tests 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 argument
  • Tests the classic exchange-argument greedy insight that scheduling jobs by deadline minimizes total weighted lateness on a single machine.

    Auto-gradedgreedyintervalsschedulingexchange-argument
  • Tests 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-gradedgreedyintervalssorting
  • Tests 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 argument
  • Tests 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

More topics