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 91–120 of 161 results
- Greedy & IntervalsMediumAuto-gradedCoalesce Touching Segments and Measure Coverage
Merge half-open integer segments that overlap or touch end-to-start, then report the merged segments in order along with their combined covered length.
Greedy & Intervalsintervalssortingsweepmerge - Greedy & IntervalsMediumAuto-gradedLocate the Lowest-Indexed Room That Can Fit a Meeting
Tests interval overlap checks under half-open semantics and using binary search on sorted, disjoint bookings to find a free room quickly.
Greedy & Intervalsintervalsbinary-searchsortinghalf-open-ranges - Greedy & IntervalsMediumAuto-gradedCount Active Ranges at Query Points
Tests whether a candidate can efficiently count how many inclusive ranges cover each of a set of query values using binary search decomposition.
Greedy & Intervalsbinary-searchintervalssorting - Greedy & IntervalsMediumAuto-gradedPeak Activity Count from Time Intervals
Tests sweep-line techniques for interval overlap detection, event aggregation at boundaries, and proper handling of half-open interval semantics.
Greedy & Intervalsintervalssweep-linesortingevent-processing - Greedy & IntervalsHardAuto-gradedMaximize Paired Sum with Coverage Constraint
Tests greedy reasoning and sorting to maximize the sum of "lesser" elements across a constrained pairing of an even-length array.
Greedy & Intervalsgreedysortingarrays - Greedy & IntervalsMediumAuto-gradedUnion Length of Half-Open Integer Intervals
Merge overlapping half-open intervals to return the total length covered by at least one interval.
Greedy & Intervalsintervalssortingsweep-linemerge - Greedy & IntervalsMediumAuto-gradedCalculate Worker Pay with Bonus Time Periods
Tests interval merging, overlap calculation, and time-based pay aggregation with capped rate multipliers.
Greedy & Intervalsintervalsarraysmath - Greedy & IntervalsMediumAuto-gradedFewest Points to Cover a Microdollar Threshold
Tests greedy selection when items have uniform cost but different values under capacity constraints.
Greedy & Intervalsgreedysortingmath - Greedy & IntervalsMediumAuto-gradedCount Active Surveillance Cameras at Each Minute
Tests the sweep-line technique by computing, for each minute in a query list, how many camera recording intervals are active at that exact moment.
Greedy & Intervalssweep lineintervalsgreedysorting - Greedy & IntervalsEasyAuto-gradedBudget Shopping from Array Suffix
Tests greedy selection with precomputation, prefix sums, and binary search to maximize item counts under budget constraints.
Greedy & Intervalsgreedybinary-searchprefix-sumsorting - Greedy & IntervalsMediumAuto-gradedMaximize Total Score by Pairing Players Optimally
Tests whether a candidate can apply a greedy sort-and-pair strategy to maximize the sum of pair minimums across a list of player ratings.
Greedy & Intervalsgreedysortingarrays - Greedy & IntervalsHardAuto-gradedMaximize Profit from Weighted Deadline-Constrained Tasks
Tests the classic weighted job scheduling with deadlines: greedily select a maximum-profit feasible subset of unit-length tasks, each with a deadline and profit, using a disjoint-set (union-find) structure for efficiency.
Greedy & Intervalsgreedyschedulingunion-findintervals - Greedy & IntervalsHardAuto-gradedMinimum 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 & IntervalsMediumAuto-gradedMaximum 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-gradedConsolidate Overlapping Time Ranges by Group
Tests interval merging within distinct groups, requiring grouping logic, sorting, and adjacent-interval handling.
Greedy & Intervalsintervalsgroupingsorting - Greedy & IntervalsMediumAuto-gradedGreedy 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-gradedConsolidate 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-gradedConsolidate Overlapping Ranges
Tests interval merging with sorting, overlapping logic, and immutability constraints
Greedy & Intervalsintervalssortinggreedyarrays - Greedy & IntervalsMediumAuto-gradedFind 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-gradedIdentify 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-gradedConsolidate Overlapping Ranges
Tests interval merging logic, correctly handling touching boundaries, nested ranges, and producing sorted disjoint output.
Greedy & Intervalsintervalssortinggreedy - Greedy & IntervalsMediumAuto-gradedFewest 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-gradedConsecutive-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-gradedTrack Segment Coverage by Expanding Intervals
Tests interval merging and coverage detection with streaming data updates.
Greedy & Intervalsintervalsmerge-intervalsdata-structuresstreaming - Greedy & IntervalsMediumAuto-gradedConsolidate 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 & IntervalsMediumAuto-gradedMinimum 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-gradedFill 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-gradedCollect 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-gradedSingle 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-gradedMaximize 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