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 121–150 of 181 results
Tests greedy inversion-counting on a binary string to find the minimum number of adjacent swaps needed to push all 1s to the right.
Auto-gradedgreedystringsinversion-countFind the minimum operations to narrow an array's range below a threshold by transferring bounded amounts between pairs of elements.
Model answergreedybinary-searchmathoptimizationTests greedy interval scheduling and string parsing: convert "Name: HH:MM-HH:MM" strings into time intervals, then find the largest set of compatible meetings.
Auto-gradedgreedyintervalsstringsTests interval merging within distinct groups, requiring grouping logic, sorting, and adjacent-interval handling.
Auto-gradedintervalsgroupingsortingTests whether a candidate can apply a greedy one-pass argument to find the unique valid departure station in a circular gas-station problem.
Auto-gradedgreedyarraystwo-pointersTests whether a candidate can sort and linearly sweep a list of ranges to produce the minimal set of non-overlapping intervals covering all input.
Auto-gradedintervalssortinggreedyarrayTests interval merging with sorting, overlapping logic, and immutability constraints
Auto-gradedintervalssortinggreedyarraysTests 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.
Auto-gradedarraysgreedytwo-pointersTests interval reasoning, array traversal, edge case handling with boundaries, and formatting output for missing number ranges.
Auto-gradedarraysintervalsedge-casesTests interval merging logic, correctly handling touching boundaries, nested ranges, and producing sorted disjoint output.
Auto-gradedintervalssortinggreedyTests greedy interval selection and the ability to handle coverage gaps in a linear range.
Auto-gradedgreedyintervalssortingTests interval reasoning and efficient pairing: find all unordered listing pairs whose consecutive availability windows together cover a full date range.
Auto-gradedintervalsbinary-searchhashingsortingTests interval merging and coverage detection with streaming data updates.
Auto-gradedintervalsmerge-intervalsdata-structuresstreamingTests whether a candidate can sort and scan a list of closed intervals to collapse all overlapping or touching ranges into a minimal merged set.
Auto-gradedintervalssortinggreedyGiven delivery records with overlapping intervals per courier, find the maximum number of distinct couriers working simultaneously using a sweep-line algorithm.
Model answersweep-lineintervalsdeduplicationsortingTests whether a candidate can reframe a resource-allocation problem as peak interval overlap and handle half-open boundary conditions correctly.
Auto-gradedintervalssweep-linegreedysortingTests 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.
Auto-gradedgreedysortingbounded-knapsackTests modular arithmetic insight and greedy reasoning to determine which resources are reachable under constrained movement rules.
Auto-gradedgreedymodular-arithmeticarraysTests finding the maximum profit from one purchase and one sale in a price sequence using a single-pass greedy approach.
Auto-gradedgreedyarrayssliding-windowTests greedy reasoning and run-based reformulation to optimally spend a limited number of schedule changes for maximum earnings with streak bonuses.
Auto-gradedgreedydynamic-programmingarraysTests whether a venue is open at a given weekday and time, handling multiple daily windows, overnight shifts, and week-boundary wraparound.
Auto-gradedintervalssimulationboundary-conditionsTests ability to sort intervals and merge adjacent or overlapping ranges into a minimal disjoint set.
Auto-gradedarrayssortinggreedyTests interval overlap detection using sweep-line or heap techniques to find the maximum number of simultaneously active tasks.
Auto-gradedintervalssortingheapsweep-lineTests whether a candidate can use sweep-line event counting to locate the smallest integer covered by the greatest number of closed intervals.
Auto-gradedsweep-lineintervalsdifference-arrayTests the classic greedy exchange-argument insight: sort jobs by deadline to maximise the number of unit-length jobs completed before their deadlines.
Auto-gradedgreedyintervalssorting- Count Valid Sum PairsMedium
Tests greedy two-pointer technique on sorted arrays to maximize disjoint pairs meeting a sum condition.
Auto-gradedtwo-pointersgreedysorting Tests greedy scheduling with frequency counting to compute minimum execution time under per-task-type cooldown constraints.
Auto-gradedgreedyfrequency-countingschedulingTests greedy two-pointer coordination and integer division to equalize values with minimal movement.
Auto-gradedgreedytwo-pointersmathsimulationTests whether you can compute the minimum number of item relocations to rebalance inventory across four warehouse zones using surplus/deficit reasoning.
Auto-gradedgreedyarraysoptimizationTests interval merging through sorting and linear scanning, focusing on edge-case handling for touching and nested ranges.
Auto-gradedintervalssortingarrays