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 181 results

  • Greedy & IntervalsHardAuto-graded
    Minimum Adjacent Swaps to Sort a Binary String

    Tests greedy inversion-counting on a binary string to find the minimum number of adjacent swaps needed to push all 1s to the right.

    Greedy & Intervalsgreedystringsinversion-count
  • Greedy & IntervalsHardModel answer
    Equalize Array Range with Bounded Transfers

    Find the minimum operations to narrow an array's range below a threshold by transferring bounded amounts between pairs of elements.

    Greedy & Intervalsgreedybinary-searchmathoptimization
  • Greedy & IntervalsMediumAuto-graded
    Maximum Non-Overlapping Meetings in a Workday

    Tests greedy interval scheduling and string parsing: convert "Name: HH:MM-HH:MM" strings into time intervals, then find the largest set of compatible meetings.

    Greedy & Intervalsgreedyintervalsstrings
  • Greedy & IntervalsEasyAuto-graded
    Consolidate Overlapping Time Ranges by Group

    Tests interval merging within distinct groups, requiring grouping logic, sorting, and adjacent-interval handling.

    Greedy & Intervalsintervalsgroupingsorting
  • Greedy & IntervalsMediumAuto-graded
    Greedy Starting Point for a Circular Fuel Route

    Tests whether a candidate can apply a greedy one-pass argument to find the unique valid departure station in a circular gas-station problem.

    Greedy & Intervalsgreedyarraystwo-pointers
  • Greedy & IntervalsMediumAuto-graded
    Consolidate Overlapping Time Ranges

    Tests whether a candidate can sort and linearly sweep a list of ranges to produce the minimal set of non-overlapping intervals covering all input.

    Greedy & Intervalsintervalssortinggreedyarray
  • Greedy & IntervalsMediumAuto-graded
    Consolidate Overlapping Ranges

    Tests interval merging with sorting, overlapping logic, and immutability constraints

    Greedy & Intervalsintervalssortinggreedyarrays
  • Greedy & IntervalsMediumAuto-graded
    Find the Highest-Scoring Boundary Pair in an Array

    Tests whether a candidate can exploit a telescoping sum identity to reduce an interval scoring problem to a fast two-endpoint selection with careful tie-breaking.

    Greedy & Intervalsarraysgreedytwo-pointers
  • Greedy & IntervalsMediumAuto-graded
    Identify Gaps in a Sorted Array Within Bounds

    Tests interval reasoning, array traversal, edge case handling with boundaries, and formatting output for missing number ranges.

    Greedy & Intervalsarraysintervalsedge-cases
  • Greedy & IntervalsMediumAuto-graded
    Consolidate Overlapping Ranges

    Tests interval merging logic, correctly handling touching boundaries, nested ranges, and producing sorted disjoint output.

    Greedy & Intervalsintervalssortinggreedy
  • Greedy & IntervalsMediumAuto-graded
    Fewest Irrigation Devices to Water a Linear Garden

    Tests greedy interval selection and the ability to handle coverage gaps in a linear range.

    Greedy & Intervalsgreedyintervalssorting
  • Greedy & IntervalsMediumAuto-graded
    Consecutive-Range Handoff Pairs for Interval Coverage

    Tests interval reasoning and efficient pairing: find all unordered listing pairs whose consecutive availability windows together cover a full date range.

    Greedy & Intervalsintervalsbinary-searchhashingsorting
  • Greedy & IntervalsMediumAuto-graded
    Track Segment Coverage by Expanding Intervals

    Tests interval merging and coverage detection with streaming data updates.

    Greedy & Intervalsintervalsmerge-intervalsdata-structuresstreaming
  • Greedy & IntervalsMediumAuto-graded
    Consolidate Overlapping Time Ranges

    Tests whether a candidate can sort and scan a list of closed intervals to collapse all overlapping or touching ranges into a minimal merged set.

    Greedy & Intervalsintervalssortinggreedy
  • Greedy & IntervalsMediumModel answer
    Peak Active Couriers: Sweep-Line with Per-Worker Deduplication

    Given delivery records with overlapping intervals per courier, find the maximum number of distinct couriers working simultaneously using a sweep-line algorithm.

    Greedy & Intervalssweep-lineintervalsdeduplicationsorting
  • Greedy & IntervalsMediumAuto-graded
    Minimum Classrooms to Schedule All Lectures

    Tests whether a candidate can reframe a resource-allocation problem as peak interval overlap and handle half-open boundary conditions correctly.

    Greedy & Intervalsintervalssweep-linegreedysorting
  • Greedy & IntervalsMediumAuto-graded
    Fill a Cargo Hold for Maximum Value With Limited Item Supply

    Tests whether a candidate can recognize that a bounded knapsack with uniform item weight reduces to a greedy sort-and-fill, handling large capacities and stock counts efficiently.

    Greedy & Intervalsgreedysortingbounded-knapsack
  • Greedy & IntervalsMediumAuto-graded
    Collect Coins with Fixed-Jump Pieces

    Tests modular arithmetic insight and greedy reasoning to determine which resources are reachable under constrained movement rules.

    Greedy & Intervalsgreedymodular-arithmeticarrays
  • Greedy & IntervalsMediumAuto-graded
    Single Buy-Sell Stock Gain

    Tests finding the maximum profit from one purchase and one sale in a price sequence using a single-pass greedy approach.

    Greedy & Intervalsgreedyarrayssliding-window
  • Greedy & IntervalsMediumAuto-graded
    Maximize Pay by Filling Gaps in a Shift Schedule

    Tests greedy reasoning and run-based reformulation to optimally spend a limited number of schedule changes for maximum earnings with streak bonuses.

    Greedy & Intervalsgreedydynamic-programmingarrays
  • 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