practice a little every day — you've got this ♡
Greedy & Intervals Interview Problems
Practice 5967 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.
- 5967
- Problems
- 2210
- Auto-graded
- 15
- Topics
- 272
- Added today
Showing 31–60 of 181 results
- Greedy & IntervalsEasyAuto-gradedIndices of Ranges Fully Inside a Query Range
Scan a list of closed integer ranges and return the indices of those lying entirely within a given query range, testing inclusive boundary handling.
Greedy & Intervalsintervalsarrayscanboundary-conditions - Greedy & IntervalsHardAuto-gradedFind Continuous Peak Resource Load
Find the maximum aggregate load over a set of half-open intervals and identify the earliest contiguous time window sustaining it.
Greedy & Intervalssweep-lineintervalsarrayssorting - Greedy & IntervalsEasyAuto-gradedTill Payout: Greedy Bills and Coins, Listed A to Z
Parse decimal money strings exactly into cents, detect underpayment or exact payment, then greedily break the change into named bills and coins and output them sorted alphabetically.
Greedy & Intervalsgreedystringsparsingsorting - Greedy & IntervalsMediumModel answerTrim Overlapping Ranges to Limit Capacity
Truncate overlapping integer intervals so no point is covered by more than k ranges while minimizing the total removed coverage.
Greedy & Intervalsintervalssweep-lineheapgreedy - Greedy & IntervalsMediumAuto-gradedMinimum Time Slots for Cooldown-Constrained Jobs
Compute the shortest timeline needed to run labeled jobs when equal labels must be separated by a cooldown, using frequency counting and a greedy frame argument.
Greedy & Intervalsgreedycountingschedulingmath - Greedy & IntervalsMediumModel answerDecode Non-Overlapping Keyphrase Spans from BERT Logits
Implement a decoder that converts token start and end logits into non-overlapping character spans using offset mappings and greedy selection.
Greedy & Intervalsstringsgreedy-intervalsmachine-learningsorting - Greedy & IntervalsEasyAuto-gradedSettle Shared Expenses With a Two-Pointer Payment Plan
Turn a map of net balances into a deterministic list of payments that zeroes every account, using a sorted two-pointer greedy match between debtors and creditors.
Greedy & Intervalsgreedytwo-pointershash-mapsorting - Greedy & IntervalsMediumAuto-gradedCombine Two Ordered Schedules into One Gap-Free Timeline
Merge two sorted lists of internally disjoint closed intervals into one sorted, disjoint list, joining overlapping or endpoint-touching intervals, in linear time.
Greedy & Intervalsintervalstwo-pointersmergesweep-line - Greedy & IntervalsMediumAuto-gradedFewest Rooms to Host All Bookings
Find the smallest number of rooms that can host every booking at once, where a booking may begin the moment another one ends, using sorting and a min-heap.
Greedy & Intervalsintervalsmin-heapsortinggreedy - Greedy & IntervalsMediumAuto-gradedFewest Segment Boosts to Make a Sequence Non-Decreasing
Compute the minimum number of +1 contiguous-segment updates needed to make an array non-decreasing, using adjacent differences and a lower-bound argument.
Greedy & Intervalsdifference-arraygreedyarraysrange-updates - Greedy & IntervalsMediumAuto-gradedFewest Steps on a Faulty Calculator: Decrement or Double
Find the minimum number of decrement-by-one and double operations needed to turn one positive integer into another, which rewards working backward from the target with a greedy rule.
Greedy & Intervalsgreedymathreverse-thinking - Greedy & IntervalsEasyAuto-gradedFilter Financial Logs by Active Premium Periods
Filter a chronological sequence of transaction records based on whether they fall within active premium membership intervals.
Greedy & Intervalsintervalsdata-filteringhash-table - Greedy & IntervalsEasyAuto-gradedPartition Array Under Segment Capacity Limit
Determine the minimum number of contiguous segments needed to split an array such that no segment's total sum exceeds a specified capacity limit.
Greedy & Intervalsarraysgreedy - Greedy & IntervalsMediumAuto-gradedLongest Streak of Growing Daily Distinct Picks
Find how many days a growing-size distinct-item picking schedule can run, using binary search on the answer plus a capacity feasibility check.
Greedy & Intervalsgreedybinary-searchprefix-sumsfeasibility-check - Greedy & IntervalsHardAuto-gradedSimulate Trading Order Fill Rate Limit
Simulate order executions under a time-windowed volume participation constraint using a sliding window.
Greedy & Intervalssliding-windowqueuegreedytime-series - Greedy & IntervalsMediumAuto-gradedCollapse Booking Windows into Non-Touching Blocks
Merge inclusive ranges that share at least one point into a sorted list of disjoint ranges, testing sorting, a linear sweep, and correct handling of touching endpoints and nesting.
Greedy & Intervalsintervalssortingsweepgreedy - Greedy & IntervalsMediumAuto-gradedLargest Group Anchored by One Overlapping Interval
Find the largest set of intervals that all intersect one chosen anchor interval, using sorting and binary search to beat quadratic time.
Greedy & Intervalsintervalsbinary-searchsortingcounting - Greedy & IntervalsMediumAuto-gradedFewest Brackets to Add for a Balanced String
Count the fewest parenthesis insertions needed to make a string of brackets balanced, using a single left-to-right pass with a running counter.
Greedy & Intervalsgreedystringsparenthesescounter - Greedy & IntervalsMediumAuto-gradedLargest Number With Even Counts of Both Digits
Delete characters from a string of 1s and 2s so both digit counts are even and the number is largest, testing greedy deletion with parity reasoning.
Greedy & Intervalsgreedystringstacksubsequence - Greedy & IntervalsMediumAuto-gradedBiggest Cabin Party Respecting Everyone's Companion Limits
Find the largest group size k where at least k people accept exactly k-1 companions, using interval counting with a difference array in linear time.
Greedy & Intervalsdifference-arrayintervalscountingprefix-sum - Greedy & IntervalsMediumAuto-gradedEven Budget Split Under Per-Person Caps
Split a budget as evenly as possible among people with individual caps, using a binary-searched fill level plus a lowest-index-first remainder rule.
Greedy & Intervalsgreedybinary-searchwater-fillingarrays - Greedy & IntervalsMediumAuto-gradedCombine Overlapping Ranges and Count Unique Land Shapes
Merge overlapping or touching closed ranges, and count land regions in a binary grid that differ in shape when only shifting is allowed.
Greedy & Intervalsintervalssortingdfsgrid - Greedy & IntervalsMediumAuto-gradedMinimum Resources Required for Scheduled Jobs
Determine the minimum number of resources required to run a schedule of tasks given start and end times with boundary reuse allowed.
Greedy & Intervalsgreedy-intervalsheaps-sortingarrays - Greedy & IntervalsMediumAuto-gradedFewest Conference Rooms for a Day of Bookings
Find the fewest rooms that can host every booking in an unordered list of half-open time ranges, where back-to-back bookings may share a room.
Greedy & Intervalsintervalssweep-linesortinggreedy - Greedy & IntervalsMediumAuto-gradedCount Total Pipeline Output Within Time Constraint
Compute the maximum number of items processed by a sequential single-threaded worker within a total allowed time limit.
Greedy & Intervalsgreedyarraysmath - Greedy & IntervalsMediumModel answerPeak Overlap Point, Bounded BST Sums, and Call-Stack Self Time
Three separate tasks: find an integer with the highest interval overlap, sum BST values within a range (plus many-query speedups), and compute per-function self time from nested start/end logs.
Greedy & Intervalssweep-linebstprefix-sumsstack - Greedy & IntervalsEasyAuto-gradedDoes a New Booking Collide With Existing Slots?
Decide whether a proposed half-open time slot shares any time with a list of unsorted booked slots, testing overlap logic and correct handling of touching endpoints.
Greedy & Intervalsintervalsoverlaphalf-openlinear-scan - Greedy & IntervalsMediumAuto-gradedText Formatting and Dynamic Schedule Tracker
Perform greedy text wrapping to fixed line widths alongside dynamic interval point queries with insertion and removal.
Greedy & Intervalsgreedyintervalsfenwick-treecoordinate-compression - Greedy & IntervalsMediumAuto-gradedCalculate Max Trading Returns from Multi-Asset Feed
Process an unordered multi-asset market feed to find the maximum possible cumulative profit across all tickers.
Greedy & Intervalsarraysgreedysortinghash-map - Greedy & IntervalsEasyAuto-gradedExtract Continuous Active Time Windows
Process chronological sensor sample logs to extract continuous active periods matching a minimum elapsed duration requirement.
Greedy & Intervalsgreedy-intervalsarraystwo-pointers