practice a little every day — you've got this ♡
Greedy & Intervals Interview Problems
Practice 5965 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.
- 5965
- Problems
- 2208
- Auto-graded
- 15
- Topics
- 271
- Added today
Showing 1–20 of 20 results
- Greedy & IntervalsMediumModel answerFind the Largest Non-Decreasing Integer Below N
Find the maximum integer less than or equal to n whose decimal digits do not decrease from left to right.
Greedy & Intervalsgreedymath-bitsstrings - Greedy & IntervalsMediumModel answerStaffing Timeline from Overlapping Work Shifts
Turn a list of overlapping employee shifts into contiguous time segments, each listing who is on duty, with empty segments marking gaps in coverage.
Greedy & Intervalssweep-lineintervalshash-mapsorting - 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 & 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 & 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 & 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 & 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 & 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 & 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 & 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 & IntervalsMediumModel answerSplit Overlapping Support Windows by Who Is Covering
Break a set of possibly overlapping staffed time windows into disjoint half-open segments, each labeled with the sorted set of people covering it, dropping gaps and merging equal neighbors.
Greedy & Intervalssweep-lineintervalshash-mapsorting - Greedy & IntervalsHardModel answerPayroll From an Event Log With Surge Windows
Turn a day's delivery events into total driver pay, then add doubled-rate surge windows by splitting intervals at boundaries, and decide how to handle messy or inconsistent logs.
Greedy & Intervalsintervalsevent-processinghashingsorting - Greedy & IntervalsMediumModel answerBusiest Stretches of a Garage from Gate Scanner Records
Use unsorted gate scan records to find peak car occupancy and the maximal time windows at that peak, including when some exit scans are missing and stays are capped.
Greedy & Intervalssweep-lineintervalsevent-processingsorting - Greedy & IntervalsMediumModel answerAssign Support Tickets to Agents Within Concurrency Limits
Given a list of fixed-time support tickets, assign each to an agent while respecting per-client concurrency caps and an optional agent pool size.
Greedy & Intervalsgreedyinterval-schedulingheapsweep-line - Greedy & IntervalsMediumModel answerMinimum Shift Count for Concurrent Task Scheduling
Given tasks with time windows and resource demands, find the fewest parallel workers needed so no worker exceeds capacity K at any moment.
Greedy & Intervalsgreedyintervalsheapbin-packing - Greedy & IntervalsMediumModel answerMerge Active Intervals from Multiple Time-Series Sensors
Parse sensor streams into continuous activity windows and find time ranges where all sensors are simultaneously active.
Greedy & Intervalsintervalstime-seriesintersectiontwo-pointers - Greedy & IntervalsMediumModel answerPacking a Fixed-Size Block from a Large Mempool with CPFP
Design a fee-maximizing transaction selector for a size-capped block, extend it to parent/child dependencies with CPFP scoring, and derive a minimum child fee.
Greedy & Intervalsgreedyknapsackdependency-trackingcryptocurrency - Greedy & IntervalsMediumModel answerFirst Open Meeting Window Across All Employees
Sweep merged busy intervals to find the earliest gap of a required duration that fits within every employee's working hours.
Greedy & Intervalsintervalsheapmergescheduling - Greedy & IntervalsHardModel answerEqualize Array Range with Bounded Transfers
Find the minimum operations to narrow an array's range below a threshold by transferring bounded amounts between pairs of elements.
Greedy & Intervalsgreedybinary-searchmathoptimization - Greedy & IntervalsMediumModel answerPeak Active Couriers: Sweep-Line with Per-Worker Deduplication
Given delivery records with overlapping intervals per courier, find the maximum number of distinct couriers working simultaneously using a sweep-line algorithm.
Greedy & Intervalssweep-lineintervalsdeduplicationsorting