Topic
Heaps, Sorting & Search interview problems
Priority queues, binary search and custom ordering. 200 original problems, each with hidden test cases you can run in the browser.
24 easy163 medium13 hard
Showing 151–180 of 200 results
Tests greedy algorithm design and min-heap operations to repeatedly merge pairs optimally.
Auto-gradedheapgreedypriority-queueFind a hidden number using binary search when each query returns the result of your previous guess instead of your current one.
Model answerbinary-searchalgorithmsfeedback-systemsTests array manipulation, hash-based deduplication, and implementing an O(n log n) sort from scratch without relying on built-in sort utilities.
Auto-gradedarrayssortinghashingheapsortTests 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.
Auto-gradedbinary searchgreedysortingTests order-statistics intuition by asking candidates to extract the k-th largest element from an unsorted array without a full sort.
Auto-gradedheapsortingorder-statisticsTests ability to implement iterative binary search with correct loop invariants, boundary handling, and termination conditions.
Auto-gradedbinary-searcharraysiterativealgorithm-implementationTests the ability to simulate event scheduling with delayed assignments using two priority queues to track which resource handles the most requests.
Auto-gradedheapsimulationgreedypriority-queueTests 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.
Auto-gradedgreedysortingmathTests heap-based selection and distance computation to efficiently find the k points closest to the origin in 2D space.
Auto-gradedheapdistanceselectionoptimizationTests binary search on sorted arrays to locate a contiguous window of k elements with minimum distance to a target value.
Auto-gradedbinary-searchtwo-pointerssliding-windowTests ability to find the kth smallest element from two sorted arrays using binary search on partition counts rather than merging.
Auto-gradedbinary-searcharraystwo-pointersTests filtering, multi-level sorting with custom tie-breaking rules, and efficient top-K selection from structured data.
Auto-gradedsortingfilteringheappriority-queueTests divide-and-conquer merging and two-pointer techniques to efficiently combine many pre-sorted lists.
Auto-gradeddivide-and-conquertwo-pointersmergingTests 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.
Auto-gradedheapmergesortingImplement a single-pass, memory-efficient weighted sampler that draws k distinct items proportional to weight from a potentially huge stream.
Model answerreservoir-samplingprobabilitynumerical-stabilityheapTests 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.
Auto-gradedbinary-searcharraysmatrixTests heap-based merging of multiple sorted sequences under strict O(k) space while maintaining stable duplicate handling.
Auto-gradedheapsortingmergespace-complexityTests greedy heap-based merge cost minimization and prefix-sum sliding-window removal to minimize adjacent absolute differences.
Auto-gradedgreedyheapprefix-sumssliding-windowTests binary search boundary reasoning on a sorted sequence with duplicate timestamps and inclusive range semantics.
Auto-gradedbinary-searcharrayssortingTests 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.
Auto-gradedheapsortingtwo-pointersarraysTests frequency counting with hash maps and efficient selection of top elements using heap-based algorithms.
Auto-gradedhash-mapheapcountingfrequency-analysisTests combining priority-queue graph traversal with bottleneck optimization to find the path whose minimum cell value is maximized.
Auto-gradedgraph-traversaldijkstrabinary-searchunion-findTests two-heap streaming median maintenance combined with exact integer floor-log₂ bucketing to place each median into its enclosing power-of-two interval.
Auto-gradedheapsmedianbit-manipulationConstruct a working min-heap from scratch, then apply it to schedule dependent tasks in lexicographic order while detecting cycles.
Auto-gradedheaptopological-sortgraphdata-structuresTests binary search on the answer combined with greedy feasibility checking to minimize the maximum delivery time when assigning parcels to couriers.
Auto-gradedbinary searchgreedysortingTests 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.
Auto-gradedbinary searchgreedysortingTests greedy allocation with heap-based selection and mathematical reasoning about resource constraints under distinct-element requirements.
Auto-gradedgreedyheapcombinatoricsTests knowledge of two-phase external sorting: chunking a sequence into fixed-size sorted runs, then merging them efficiently with a min-heap.
Auto-gradedheapsortingmergesimulationTests 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.
Auto-gradedbinary-searchsortingprobabilityarraysTests understanding of lower-bound binary search with correct boundary handling and duplicate treatment.
Auto-gradedbinary-searchboundariesduplicates