KatInterview

practice a little every day — you've got this ♡

Greedy & Intervals Interview Problems

Practice 5971 original coding, SQL, system design, machine learning and behavioral problems across 15 topics. Coding and SQL problems run against hidden test cases right in your browser; every problem has hints and a worked solution, free.

5971
Problems
2211
Auto-graded
15
Topics
272
Added today

Showing 121–150 of 161 results

  • Greedy & IntervalsMediumAuto-graded
    Venue Hours Checker with Overnight and Multi-Window Schedules

    Tests whether a venue is open at a given weekday and time, handling multiple daily windows, overnight shifts, and week-boundary wraparound.

    Greedy & Intervalsintervalssimulationboundary-conditions
  • Greedy & IntervalsMediumAuto-graded
    Consolidate Overlapping Ranges

    Tests ability to sort intervals and merge adjacent or overlapping ranges into a minimal disjoint set.

    Greedy & Intervalsarrayssortinggreedy
  • Greedy & IntervalsMediumAuto-graded
    Peak Concurrent Tasks: Minimum Workers Needed

    Tests interval overlap detection using sweep-line or heap techniques to find the maximum number of simultaneously active tasks.

    Greedy & Intervalsintervalssortingheapsweep-line
  • Greedy & IntervalsMediumAuto-graded
    Peak Overlap Point Across Closed Intervals

    Tests whether a candidate can use sweep-line event counting to locate the smallest integer covered by the greatest number of closed intervals.

    Greedy & Intervalssweep-lineintervalsdifference-array
  • Greedy & IntervalsEasyAuto-graded
    Schedule Maximum Jobs Within Deadlines

    Tests the classic greedy exchange-argument insight: sort jobs by deadline to maximise the number of unit-length jobs completed before their deadlines.

    Greedy & Intervalsgreedyintervalssorting
  • Greedy & IntervalsMediumAuto-graded
    Count Valid Sum Pairs

    Tests greedy two-pointer technique on sorted arrays to maximize disjoint pairs meeting a sum condition.

    Greedy & Intervalstwo-pointersgreedysorting
  • Greedy & IntervalsMediumAuto-graded
    Task Scheduler with Cooldown Periods

    Tests greedy scheduling with frequency counting to compute minimum execution time under per-task-type cooldown constraints.

    Greedy & Intervalsgreedyfrequency-countingscheduling
  • Greedy & IntervalsMediumAuto-graded
    Balance Wealth Through Optimal Integer Transfers

    Tests greedy two-pointer coordination and integer division to equalize values with minimal movement.

    Greedy & Intervalsgreedytwo-pointersmathsimulation
  • Greedy & IntervalsMediumAuto-graded
    Minimum Transfers to Rebalance a Four-Zone Warehouse

    Tests whether you can compute the minimum number of item relocations to rebalance inventory across four warehouse zones using surplus/deficit reasoning.

    Greedy & Intervalsgreedyarraysoptimization
  • Greedy & IntervalsMediumAuto-graded
    Combine Overlapping Intervals

    Tests interval merging through sorting and linear scanning, focusing on edge-case handling for touching and nested ranges.

    Greedy & Intervalsintervalssortingarrays
  • Greedy & IntervalsMediumAuto-graded
    Maximum Concurrent Reservations

    Calculate the peak number of overlapping time intervals to determine minimum resource capacity.

    Greedy & Intervalsintervalssweep-linesorting
  • Greedy & IntervalsEasyAuto-graded
    Intercept Aircraft and Count User Sessions

    Tests greedy deadline scheduling for time-critical interception tasks and event grouping with gap-based sessionization.

    Greedy & Intervalsgreedysortingsimulationevent-processing
  • Greedy & IntervalsMediumAuto-graded
    Optimal 1D Coverage: Minimize Worst-Case Distance to k Centers

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

    Greedy & Intervalsbinary-searchgreedysorting
  • Greedy & IntervalsMediumAuto-graded
    Minimum Conference Rooms for Scheduled Meetings

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

    Greedy & Intervalsintervalsheapgreedyscheduling
  • Greedy & IntervalsEasyAuto-graded
    Count Rooms In Use at Peak Time

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

    Greedy & Intervalsgreedysweep lineintervals
  • Greedy & IntervalsMediumAuto-graded
    Minimum Paint Strokes to Cover a Board

    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.

    Greedy & Intervalsgreedyintervalssorting
  • Greedy & IntervalsMediumAuto-graded
    Schedule Maximum Jobs Before Their Deadlines

    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.

    Greedy & Intervalsgreedyschedulingintervalssorting
  • Greedy & IntervalsMediumAuto-graded
    Maximum Placement with Spacing Constraints

    Tests greedy iteration with adjacency rules, requiring precise edge-case handling and index management.

    Greedy & Intervalsgreedyarraysiteration
  • Greedy & IntervalsEasyAuto-graded
    Locate Shared Free Time Slots Across Multiple Schedules

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

    Greedy & Intervalsintervalsmergingscheduling
  • Greedy & IntervalsMediumAuto-graded
    Maximize Tasks Completed Before Their Deadlines

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

    Greedy & Intervalsgreedyintervalsscheduling
  • Greedy & IntervalsMediumAuto-graded
    Maximum Sum Window Over Sparse Value Ranges

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

    Greedy & Intervalssliding-windowtwo-pointersintervalsmodular-arithmetic
  • Greedy & IntervalsMediumAuto-graded
    Task Assignment with Skill Matching and One Flexible Worker

    Tests greedy selection within independent groups and optimal placement of a single unrestricted resource.

    Greedy & Intervalsgreedyhash-tablesorting
  • Greedy & IntervalsMediumAuto-graded
    Minimum Days to Execute Sequential Jobs with Cooldown

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

    Greedy & Intervalsgreedyhash-mapsimulation
  • Greedy & IntervalsMediumAuto-graded
    Merge Overlapping Regions from Two Sorted Interval Lists

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

    Greedy & Intervalsintervalstwo-pointerssortingarrays
  • Greedy & IntervalsMediumAuto-graded
    Locate Uncovered Ranges Between Intervals

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

    Greedy & Intervalsintervalssortingmergingranges
  • Greedy & IntervalsMediumAuto-graded
    Minimum Deletions to Remove Half the Elements

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

    Greedy & Intervalsgreedyhashingsorting
  • Greedy & IntervalsMediumAuto-graded
    Fill Bag with Maximum Value from Identical-Weight Items

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

    Greedy & Intervalsgreedysortingoptimization
  • Greedy & IntervalsMediumAuto-graded
    Budget-Constrained Round-Trip Selection

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

    Greedy & Intervalsgreedysortingarrays
  • Greedy & IntervalsMediumAuto-graded
    Find Available Time Slots in a Repeating Weekly Schedule

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

    Greedy & Intervalsintervalsarraystime-zones
  • Greedy & IntervalsMediumAuto-graded
    Consolidate Half-Open Interval Ranges

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

    Greedy & Intervalsintervalssortinggreedyarray-manipulation