KatInterview

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.

Problems200

24 easy163 medium13 hard

Showing 181–200 of 200 results

  • Tests ability to maintain order statistics efficiently in a streaming context using heap-based data structures.

    Auto-gradedheapsstreaming-algorithmsdata-structures
  • Find how many sorted items fit within a budget using prefix sums and binary search, then parse a graph and compute the shortest path between two nodes.

    Model answerbinary-searchdijkstraprefix-sumshortest-path
  • Determine the maximum revenue when fulfilling orders from inventory where each item's price equals its current stock level and decreases with each sale.

    Model answerbinary-searchgreedymathpriority-queue
  • Tests binary search on the answer to find the minimum possible largest piece when splitting a log into at least K+1 pieces.

    Auto-gradedbinary searchgreedysorting
  • Tests binary search on sorted lists to efficiently count distinct entities with at least one event in a sliding time range.

    Auto-gradedbinary-searchtime-seriessliding-window
  • Tests median maintenance using two heaps to efficiently return the running median after each element is added to a growing sequence.

    Auto-gradedheapssortingmedian maintenance
  • Find how many ways to pick three numbers from an array where the maximum minus the minimum stays within a given threshold.

    Auto-gradedsortingtwo-pointerscombinatorics
  • Tests efficient counting of distinct values in a sorted array using binary search to skip duplicate runs, achieving better than linear time complexity.

    Auto-gradedbinary-searcharraysoptimization
  • Find the minimal rate to process items within a time limit, then consolidate overlapping ranges into non-overlapping spans.

    Model answerbinary-searchintervalsgreedyoptimization
  • Tests sorting and aggregation skills by computing tournament standings with points, goal difference, and goals scored as tie-breakers.

    Auto-gradedsortingsimulationaggregation
  • Identify the earliest index where a boolean array transitions from False to True, testing binary search on boundaries and edge cases.

    Auto-gradedbinary-searcharraysboundaries
  • Tests multi-criteria sorting with position-based vote counting and lexicographic tiebreaking.

    Auto-gradedsortingcustom-comparatorcounting
  • Reorder a sorted array by absolute value in linear time, then find the k-th element in that order using logarithmic-time search without materializing the full result.

    Model answerbinary-searchtwo-pointersorder-statisticsarray-manipulation
  • Tests binary search on the answer to find the minimum possible maximum delivery time when assigning shipments to warehouses with limited daily capacity.

    Auto-gradedbinary searchgreedysorting
  • Tests the ability to sort a list of tasks using a multi-key custom comparator involving deadlines, priorities, and tie-breaking rules.

    Auto-gradedsortingcustom sort keysheaps
  • Tests ability to retrieve the k most frequent words from a list, using lexicographic order as a tie-breaker, via a heap or sort-based approach.

    Auto-gradedheapsortinghash map
  • Tests ability to rank words by a weighted frequency-length score, applying top-k selection with a precise tie-breaking rule.

    Auto-gradedheapsortingtop-kstrings
  • Tests median maintenance by computing the running median after each element is inserted into a growing sequence, using a two-heap approach.

    Auto-gradedheapssortingmedian maintenance
  • Tests ability to binary search on the answer to find the minimum possible maximum workload when distributing tasks among workers.

    Auto-gradedbinary searchgreedysorting
  • Tests the ability to design a multi-key custom sort comparator over aggregated data using a priority-queue-style ranking of teams from ranked ballots.

    Auto-gradedsortingcustom sort keyshash maps

More topics