practice a little every day — you've got this ♡
Greedy & Intervals Interview Problems
Practice 5969 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.
- 5969
- Problems
- 2211
- Auto-graded
- 15
- Topics
- 272
- Added today
Showing 61–90 of 181 results
- Greedy & IntervalsMediumAuto-gradedWildcard Brackets: Can the Sequence Be Made Valid?
Decide if a string of brackets and wildcards can be made valid by choosing each wildcard's role, testing range-tracking of reachable open counts or a greedy two-pass argument.
Greedy & Intervalsgreedystringsparenthesesdynamic-programming - Greedy & IntervalsEasyAuto-gradedSummarize Integer Ranges into String
Process an unorganized array of integers by sorting, deduplicating, and formatting contiguous numerical ranges into a compact string.
Greedy & Intervalsarrayssortingintervalsstrings - Greedy & IntervalsMediumAuto-gradedCollapse Booked Time Slots into Disjoint Blocks
Combine a list of [start, end] ranges so that any that overlap or touch become one range, using sorting and a single sweep.
Greedy & Intervalsintervalssortinggreedyarrays - Greedy & IntervalsMediumModel answerPinpoint Bad Nodes with Disjoint Group Probes of Size Two or More
Find exactly which cluster nodes are bad when the only probe is a group test that fails if any member is bad, parallel probes must be disjoint, and each probe needs at least two nodes.
Greedy & Intervalsgroup-testingadaptive-algorithmsround-robin-schedulingidentifiability - Greedy & IntervalsEasyAuto-gradedMinimum Days to Complete Sequential Tasks With Daily Time Budgets
Greedy single-pass simulation: pack tasks in order into daily time budgets without splitting, and return the day count or -1 if impossible.
Greedy & Intervalsgreedysimulationtwo-pointersarrays - Greedy & IntervalsMediumAuto-gradedRoom Count and Heaviest Prerequisite Chain for Sessions
Combine an interval-overlap sweep with a min-heap and a longest weighted path on a DAG using topological order.
Greedy & Intervalsintervalsmin-heaptopological-sortdag - Greedy & IntervalsMediumAuto-gradedCompute Free Windows from Schedule Constraints
Compute unreserved time windows for specified daily schedules given opening hours and existing bookings.
Greedy & Intervalsintervalssortingstringgreedy - Greedy & IntervalsMediumModel answerSmallest Vehicle Pool for Location-Bound Shuttle Runs
Given timed runs between named stops, find the fewest shuttles needed when each shuttle can only continue from the stop where its previous run ended.
Greedy & Intervalssweep-linesortingeventsgreedy - Greedy & IntervalsMediumAuto-gradedResolve Overlapping Text Edit Spans by Priority
Sweep over span boundaries with a heap to resolve overlapping inclusive edit spans using priority, original length, and input order, splitting losers into fragments.
Greedy & Intervalsintervalssweep-lineheaptie-breaking - Greedy & IntervalsMediumAuto-gradedConsolidate Overlapping Bookings in a Weekly Schedule
Parse weekday and 24-hour time strings, then merge touching or overlapping same-day bookings and output them in a canonical, sorted string format.
Greedy & Intervalsintervalssortingstring-parsingmerge-intervals - Greedy & IntervalsHardModel answerBird Physics Tick and Fee-Ratio Block Packing
Two coding tasks: a one-tick bird movement function with inclusive bounds, and a greedy block builder that scores transactions together with their unconfirmed ancestors.
Greedy & Intervalsgreedytopological-sortcycle-detectionsimulation - Greedy & IntervalsMediumAuto-gradedSubscription Windows: Purchase Attribution and Anomaly Report
Merge each user's subscription intervals, then attribute purchases to the merged windows, count September active days, and report out-of-window and overlap anomalies.
Greedy & Intervalsintervalsmerge-intervalshash-mapdatetime - Greedy & IntervalsEasyAuto-gradedMaximum Affordable Items Within Budget
Determine the maximum collection of items that can be purchased given individual item costs and a total spending limit.
Greedy & Intervalsgreedysortingarrays - Greedy & IntervalsEasyAuto-gradedFind Peak Event Density in Fixed Duration Window
Determine the maximum number of recorded logs occurring within a contiguous time interval using a sliding window approach.
Greedy & Intervalssliding-windowtwo-pointersarraysintervals - Greedy & IntervalsMediumAuto-gradedWeekly Deploy Windows with Time Zones and Blackouts
Convert weekly recurring allow and freeze windows from local time zones to UTC, subtract the freezes, and list the first usable slots after a notice period.
Greedy & Intervalsintervalssweep-linetime-zonesmodular-arithmetic - Greedy & IntervalsMediumAuto-gradedMetered Usage Bill with Special Rate Windows
Compute a total bill over a half-open time window where disjoint special-rate windows replace the default hourly rate, testing interval clipping and boundary handling.
Greedy & Intervalsintervalssweepmatharrays - Greedy & IntervalsMediumAuto-gradedAnalyze Schedule Capacity and Overlaps
Evaluate interval concurrency to determine if single-resource scheduling is possible and calculate peak concurrent demand.
Greedy & Intervalsintervalssortingheapsweep-line - Greedy & IntervalsMediumModel answerMatrix 90-Degree Clockwise Rotation and Maximum Interval Coverage
Rotate a square grid 90 degrees clockwise and identify regions of maximal overlapping intervals using a sweep-line algorithm.
Greedy & Intervalsarraysgreedy-intervalsheaps-sorting - Greedy & IntervalsMediumAuto-gradedInsert and Merge Interval into Sorted Collection
Incorporate a target range into an already sorted list of disjoint closed intervals, merging any overlapping or adjacent spans in linear time.
Greedy & Intervalsintervalsarraysgreedy - Greedy & IntervalsMediumAuto-gradedFind the Maximum Size Connected Interval Component
Find the maximum number of intervals that belong to a single connected component where edges represent inclusive interval overlaps.
Greedy & Intervalsintervalssortinggreedygraphs - Greedy & IntervalsEasyAuto-gradedSplit Chores Between Two Workers With a Fixed Quota
Choose exactly k items for the first worker to maximize total payoff, which tests reducing a problem to per-item differences and greedy top-k selection.
Greedy & Intervalsgreedysortingarraysexchange-argument - Greedy & IntervalsMediumAuto-gradedEarliest Shared Free Slot Across Several Schedules
Find the earliest meeting slot of a given length that fits inside everyone's availability window and avoids every busy block, by intersecting windows and merging busy intervals.
Greedy & Intervalsintervalssweep-linesortingscheduling - Greedy & IntervalsMediumAuto-gradedMerge Event Windows Within Each Locality
Join two record lists by id, group event time ranges by locality, merge overlapping or touching ranges, and return the merged windows in a specified sort order.
Greedy & Intervalsintervalsmerge-intervalshash-mapsorting - Greedy & IntervalsMediumModel answerReal-Time Courier-to-Delivery Matching Engine Design
Design a scalable real-time engine that matches couriers to incoming delivery requests, defining the cost model, candidate pruning, matching method, complexity, and failure handling.
Greedy & Intervalsmatchinggreedyspatial-indexreal-time - Greedy & IntervalsMediumAuto-gradedMinimum Removals for Conflict-Free Time Slots
Tests the greedy earliest-finish strategy: find the fewest ranges to discard so the rest share no interior points, with touching endpoints allowed.
Greedy & Intervalsgreedyintervalssortinginterval-scheduling - Greedy & IntervalsMediumAuto-gradedFewest Vehicles to Cover Back-to-Back Bookings
Find the peak number of simultaneously active half-open intervals using a sweep line or heap, with correct handling of ties where one booking ends as another begins.
Greedy & Intervalsintervalssweep-linesortingheap - Greedy & IntervalsMediumAuto-gradedSequential Allow/Deny Rules Over an IPv4 Block
Track an IPv4 block as disjoint integer intervals while applying ordered allow and deny CIDR rules, deciding whether the block ends up fully covered with no deny hit.
Greedy & Intervalsintervalsipv4cidrsimulation - Greedy & IntervalsMediumAuto-gradedCourier Earnings from Overlapping Order Events
Sweep over unsorted start/end events to total concurrency-weighted seconds, validate malformed input, and convert to a half-up rounded dollar string.
Greedy & Intervalsinterval sweepevent sortingvalidationexact arithmetic - Greedy & IntervalsMediumAuto-gradedEmptying Depots With a Limited Pool of Partner Skips
Compute the minimum skips each depot needs using modular arithmetic, then greedily pick the cheapest depots under a shared skip budget to maximize emptied depots.
Greedy & Intervalsgreedymathsortingmodular-arithmetic - Greedy & IntervalsEasyAuto-gradedBest Single Buy-Sell Gain from Daily Quotes
Find the largest gain from buying on one day and selling on a later day in a list of daily prices, returning 0 if no gain is possible.
Greedy & Intervalsgreedyarraysrunning-minimumsingle-pass