practice a little every day — you've got this ♡
Heaps, Sorting & Search 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
- 273
- Added today
Showing 151–180 of 200 results
- Heaps, Sorting & SearchMediumAuto-gradedMinimum Cost to Combine All Elements
Tests greedy algorithm design and min-heap operations to repeatedly merge pairs optimally.
Heaps, Sorting & Searchheapgreedypriority-queue - Heaps, Sorting & SearchHardModel answerBinary Search with Delayed Feedback Protocol
Find a hidden number using binary search when each query returns the result of your previous guess instead of your current one.
Heaps, Sorting & Searchbinary-searchalgorithmsfeedback-systems - Heaps, Sorting & SearchMediumAuto-gradedCollapse Repeat Visits and Order the Result
Tests array manipulation, hash-based deduplication, and implementing an O(n log n) sort from scratch without relying on built-in sort utilities.
Heaps, Sorting & Searcharrayssortinghashingheapsort - Heaps, Sorting & SearchMediumAuto-gradedMinimum Relay Power for Full Network Coverage
Tests binary search on the answer combined with a greedy coverage check to find the minimum broadcast power so every city is reachable from a central hub.
Heaps, Sorting & Searchbinary searchgreedysorting - Heaps, Sorting & SearchMediumAuto-gradedTop-K Cutoff: Find the K-th Highest Value
Tests order-statistics intuition by asking candidates to extract the k-th largest element from an unsorted array without a full sort.
Heaps, Sorting & Searchheapsortingorder-statistics - Heaps, Sorting & SearchMediumAuto-gradedFind Target Index in Sorted Array
Tests ability to implement iterative binary search with correct loop invariants, boundary handling, and termination conditions.
Heaps, Sorting & Searchbinary-searcharraysiterativealgorithm-implementation - Heaps, Sorting & SearchMediumAuto-gradedBusiest Conference Room Tracker
Tests the ability to simulate event scheduling with delayed assignments using two priority queues to track which resource handles the most requests.
Heaps, Sorting & Searchheapsimulationgreedypriority-queue - Heaps, Sorting & SearchMediumAuto-gradedTop-K Price Harvest from Tiered Stock Levels
Tests whether a candidate can reformulate a greedy revenue problem into summing the largest elements across union-of-range price sets and implement an O(n log n) layer-sweep solution.
Heaps, Sorting & Searchgreedysortingmath - Heaps, Sorting & SearchMediumAuto-gradedK Nearest Points to Origin
Tests heap-based selection and distance computation to efficiently find the k points closest to the origin in 2D space.
Heaps, Sorting & Searchheapdistanceselectionoptimization - Heaps, Sorting & SearchMediumAuto-gradedFind K Closest Elements in Sorted Array
Tests binary search on sorted arrays to locate a contiguous window of k elements with minimum distance to a target value.
Heaps, Sorting & Searchbinary-searchtwo-pointerssliding-window - Heaps, Sorting & SearchMediumAuto-gradedKth Element in Union of Two Sorted Lists
Tests ability to find the kth smallest element from two sorted arrays using binary search on partition counts rather than merging.
Heaps, Sorting & Searchbinary-searcharraystwo-pointers - Heaps, Sorting & SearchHardAuto-gradedSelect Best Available Venues by Ranking Criteria
Tests filtering, multi-level sorting with custom tie-breaking rules, and efficient top-K selection from structured data.
Heaps, Sorting & Searchsortingfilteringheappriority-queue - Heaps, Sorting & SearchEasyAuto-gradedCombine Multiple Sorted Lists into a Single Sorted Sequence
Tests divide-and-conquer merging and two-pointer techniques to efficiently combine many pre-sorted lists.
Heaps, Sorting & Searchdivide-and-conquertwo-pointersmerging - Heaps, Sorting & SearchMediumAuto-gradedCombine K Sorted Sequences into One
Tests whether a candidate can use a min-heap to efficiently merge multiple sorted lists into a single sorted output in O(N log k) time.
Heaps, Sorting & Searchheapmergesorting - Heaps, Sorting & SearchMediumModel answerStreaming Weighted Reservoir Sampling Without Replacement
Implement a single-pass, memory-efficient weighted sampler that draws k distinct items proportional to weight from a potentially huge stream.
Heaps, Sorting & Searchreservoir-samplingprobabilitynumerical-stabilityheap - Heaps, Sorting & SearchMediumAuto-gradedBinary Search Over a Row-Chained Sorted Grid
Tests whether a candidate can exploit strict row-chaining in a sorted matrix to locate a target value in O(log(m·n)) time using a single binary search.
Heaps, Sorting & Searchbinary-searcharraysmatrix - Heaps, Sorting & SearchMediumAuto-gradedMerge Sorted Streams with Memory Constraint
Tests heap-based merging of multiple sorted sequences under strict O(k) space while maintaining stable duplicate handling.
Heaps, Sorting & Searchheapsortingmergespace-complexity - Heaps, Sorting & SearchMediumAuto-gradedGreedy Task Merging and Segment Removal Cost
Tests greedy heap-based merge cost minimization and prefix-sum sliding-window removal to minimize adjacent absolute differences.
Heaps, Sorting & Searchgreedyheapprefix-sumssliding-window - Heaps, Sorting & SearchMediumAuto-gradedSlice a Sorted Event Stream by Timestamp Window
Tests binary search boundary reasoning on a sorted sequence with duplicate timestamps and inclusive range semantics.
Heaps, Sorting & Searchbinary-searcharrayssorting - Heaps, Sorting & SearchMediumAuto-gradedK Nearest Value Pairs in a Sorted Sequence
Tests whether a candidate can efficiently extract the k pairs with smallest gap from a sorted array using a heap-based k-way merge instead of brute force enumeration.
Heaps, Sorting & Searchheapsortingtwo-pointersarrays - Heaps, Sorting & SearchMediumAuto-gradedSelect K Elements with Highest Occurrence Count
Tests frequency counting with hash maps and efficient selection of top elements using heap-based algorithms.
Heaps, Sorting & Searchhash-mapheapcountingfrequency-analysis - Heaps, Sorting & SearchMediumAuto-gradedFind Path with Highest Bottleneck Value in Grid
Tests combining priority-queue graph traversal with bottleneck optimization to find the path whose minimum cell value is maximized.
Heaps, Sorting & Searchgraph-traversaldijkstrabinary-searchunion-find - Heaps, Sorting & SearchMediumAuto-gradedRunning Median with Power-of-Two Bucket Tracking
Tests two-heap streaming median maintenance combined with exact integer floor-log₂ bucketing to place each median into its enclosing power-of-two interval.
Heaps, Sorting & Searchheapsmedianbit-manipulation - Heaps, Sorting & SearchHardAuto-gradedBuild a Min-Heap and Schedule Tasks by Priority
Construct a working min-heap from scratch, then apply it to schedule dependent tasks in lexicographic order while detecting cycles.
Heaps, Sorting & Searchheaptopological-sortgraphdata-structures - Heaps, Sorting & SearchMediumAuto-gradedMinimize the Maximum Delivery Time Across Routes
Tests binary search on the answer combined with greedy feasibility checking to minimize the maximum delivery time when assigning parcels to couriers.
Heaps, Sorting & Searchbinary searchgreedysorting - Heaps, Sorting & SearchMediumAuto-gradedMinimum Bandwidth to Stream All Files Within Deadline
Tests binary search on the answer to find the minimum integer bandwidth that allows streaming a list of files (each with a size and deadline) without missing any deadline using a greedy scheduler.
Heaps, Sorting & Searchbinary searchgreedysorting - Heaps, Sorting & SearchMediumAuto-gradedBuild Three-Color Outfits from Limited Inventory
Tests greedy allocation with heap-based selection and mathematical reasoning about resource constraints under distinct-element requirements.
Heaps, Sorting & Searchgreedyheapcombinatorics - Heaps, Sorting & SearchMediumAuto-gradedSort a Large Sequence Using Memory-Bounded Runs and a Heap
Tests knowledge of two-phase external sorting: chunking a sequence into fixed-size sorted runs, then merging them efficiently with a min-heap.
Heaps, Sorting & Searchheapsortingmergesimulation - Heaps, Sorting & SearchMediumAuto-gradedWin Rate Between Two Weighted Dice
Tests whether a candidate can count strict-win outcome pairs across two multi-faced dice efficiently using sorting and binary search instead of a brute-force double loop.
Heaps, Sorting & Searchbinary-searchsortingprobabilityarrays - Heaps, Sorting & SearchMediumAuto-gradedFind Leftmost Position Meeting Threshold
Tests understanding of lower-bound binary search with correct boundary handling and duplicate treatment.
Heaps, Sorting & Searchbinary-searchboundariesduplicates