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 1–30 of 161 results
- Greedy & IntervalsMediumAuto-gradedConsolidate Overlapping Time Intervals
Evaluate ability to sort and combine overlapping or adjacent half-open numerical intervals in linear-arithmetic time.
Greedy & Intervalsintervalssortingarraysgreedy - Greedy & IntervalsMediumAuto-gradedPair Lab Visits with Follow-Up Consultations from 10-Minute Slots
Validate and merge 10-minute availability slots, expand them into 30-minute visits, and list every lab-then-consultation pairing with a wait of 0 to 60 minutes.
Greedy & Intervalsintervalsmergingbinary-searchsorting - Greedy & IntervalsEasyAuto-gradedSelect Best Single Task Type
Determine the task type index that maximizes total revenue within a given time budget using floor division and custom tie-breaking rules.
Greedy & Intervalsgreedyarraysmath - Greedy & IntervalsHardAuto-gradedUnion Overlapping Road Pieces That Share a Straight Line
Group integer-point polylines by the exact line they lie on, then merge overlapping or touching extents on each line into one sorted point list.
Greedy & Intervalsintervalsgeometrygcdhashing - Greedy & IntervalsMediumAuto-gradedCoalesce Overlapping Ranges Into Disjoint Spans
Combine unsorted inclusive integer ranges that share at least one point into disjoint spans ordered by start, testing endpoint handling, chained merges, and nesting.
Greedy & Intervalsintervalssortinggreedysweep - Greedy & IntervalsMediumAuto-gradedOpen Half-Hour Slots from Weekly Hours and Bookings
Expand a weekly schedule over a date range and subtract booked intervals to list every free, half-hour-aligned 30-minute slot in chronological order.
Greedy & Intervalsintervalsdatetimesimulationsorting - Greedy & IntervalsMediumAuto-gradedCanonical Path Cleanup Plus Overlapping Range Union
Combine stack-based Unix path normalization with sort-and-sweep merging of overlapping or touching closed ranges, returning both results in one list.
Greedy & Intervalsstacksortingintervalsstrings - Greedy & IntervalsHardAuto-gradedShared High-Activity Windows Across Sensor Feeds
Merge step-function sensor feeds with a sweep over status-change events to find every maximal inclusive window in which all feeds are at or above a level.
Greedy & Intervalssweep-lineintervalsstep-functionbinary-search - Greedy & IntervalsMediumAuto-gradedCollapse Booked Time Ranges Into Disjoint Blocks
Combine closed integer ranges that overlap or share an endpoint into disjoint blocks, tests sorting plus a single sweep and careful boundary handling.
Greedy & Intervalsintervalssortinggreedysweep - Greedy & IntervalsMediumAuto-gradedSmallest-ID Room Allocation for Booking Time Slots
Partition half-open time intervals across the fewest resources, deterministically giving each booking the lowest-numbered free resource, using sorting and two heaps.
Greedy & Intervalsintervalsheapgreedysorting - Greedy & IntervalsMediumAuto-gradedCombine Overlapping Time Intervals
Consolidate overlapping and adjacent closed intervals into a minimal list of disjoint intervals using sorting.
Greedy & Intervalsarraysgreedy-intervalssorting - Greedy & IntervalsMediumAuto-gradedMost Overlapped Aisle Along a Line of Lamps
Find the integer position covered by the most symmetric intervals, returning the smallest on ties, using an event sweep over interval endpoints instead of visiting every position.
Greedy & Intervalssweep-lineintervalsdifference-arraysorting - Greedy & IntervalsMediumAuto-gradedMax Speed Continuous Window on Ticked Rate Stream
Find the maximum average throughput over a continuous time window of a specified size, given rate logs over uniform time ticks.
Greedy & Intervalssliding-windowtwo-pointersgreedyprefix-sum - Greedy & IntervalsMediumAuto-gradedPeak Crew Size for Scheduled Shifts
Compute the smallest crew that covers every scheduled task by finding the peak simultaneous demand, treating each task as half-open and parsing HH:MM times.
Greedy & Intervalssweep-lineintervalsgreedysorting - Greedy & IntervalsMediumAuto-gradedMax Gains from Single and Multi-Trade Asset Strategies
Calculate maximum achievable gain for an asset sequence under single-trade and unlimited-trade restrictions.
Greedy & Intervalsarraysgreedydynamic-programming - Greedy & IntervalsMediumAuto-gradedEstimate Percentile from Histogram Buckets
Linearly interpolate a percentile value across histogram buckets assuming uniform distribution within each interval.
Greedy & Intervalsmathintervalshistogrampercentile - Greedy & IntervalsMediumAuto-gradedSentinels on a Road: Best Covered Value With Single Left Steps
Maximize the total value of covered towns on a line when each sentinel may step one town left at most once into an empty town, by finding which town each run of sentinels leaves uncovered.
Greedy & Intervalsgreedystringsarrayssegments - Greedy & IntervalsEasyAuto-gradedShift Pay Totals Across Time-of-Day Wage Bands
Sum payouts for work sessions by intersecting each session with non-overlapping hourly wage bands, using interval overlap arithmetic.
Greedy & Intervalsintervalsoverlapsimulationarrays - Greedy & IntervalsHardAuto-gradedFuse Collinear Point Chains Along Shared Lines
Group point lists by the infinite line they lie on, then fuse those that overlap or touch along that line, and return each fused group's unique points ordered along the line.
Greedy & Intervalsgeometryintervalshashingsorting - Greedy & IntervalsMediumAuto-gradedShift Tracker and Earnings Simulator
Simulate employee shifts, structural updates, bonus intervals, filtering, and time-bounded payroll computations.
Greedy & Intervalsdesignsimulationintervalssorting - Greedy & IntervalsMediumAuto-gradedBest Result After Removing a Single Five from a Number String
Remove exactly one '5' from a digit string to get the lexicographically largest result of equal length, using a greedy scan and preserving leading zeros.
Greedy & Intervalsgreedystringsdigitsexchange-argument - Greedy & IntervalsEasyAuto-gradedConflict-Free Schedule Check for a Single Attendee
Tests sorting intervals and scanning adjacent pairs to detect overlaps under half-open interval rules, where touching endpoints are allowed.
Greedy & Intervalsintervalssortinggreedyarrays - Greedy & IntervalsMediumAuto-gradedPeak Overlap of Half-Open Time Ranges
Compute the largest number of simultaneously running half-open time ranges using a sweep over sorted start and end events, with correct handling of ties at boundaries.
Greedy & Intervalssweep-lineintervalssortinghalf-open-intervals - Greedy & IntervalsMediumAuto-gradedMaximum Number With Even Counts of Ones and Twos
Delete characters from a string of 1s and 2s so both digit counts are even, and return the largest possible number. Tests greedy subsequence construction with count constraints.
Greedy & Intervalsgreedystringssubsequencelexicographic - Greedy & IntervalsMediumAuto-gradedMinimum Concurrent Resources for Overlapping Intervals
Find the maximum number of overlapping intervals at any instant using sweep line or heap techniques.
Greedy & Intervalsintervalssweep-lineheapsorting - Greedy & IntervalsMediumAuto-gradedLargest Set of Compatible Time Slots on One Worker
Find the largest subset of half-open time intervals that can run on one worker without overlap, testing greedy interval selection by earliest finish.
Greedy & Intervalsgreedyintervalssorting - Greedy & IntervalsMediumAuto-gradedFewest Badges for a Row of Scored Players
Greedy two-pass array problem: assign the minimum total badges so each player gets at least one and any player scoring higher than an adjacent player gets strictly more badges.
Greedy & Intervalsgreedyarraytwo-passneighbors - Greedy & IntervalsMediumAuto-gradedCourier Pay with Overlap Multipliers, Waits and Peak Windows
Sweep-line over time intervals: pay grows with the square of concurrent deliveries, store-wait minutes are isolated, and peak windows double the rate.
Greedy & Intervalssweep-lineintervalsevent-sortingsimulation - 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