KatInterview

practice a little every day — you've got this ♡

Coding Interview Problems

Practice 6025 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.

6025
Problems
2231
Auto-graded
15
Topics
273
Added today

Showing 961–990 of 2784 results

  • Trees & GraphsMediumAuto-graded
    Cheapest Dungeon Escape Through Monster Cells

    Find the minimum number of monster cells entered on any route from start to exit in a grid with walls, using a weighted shortest-path search such as Dijkstra or 0-1 BFS.

    Trees & Graphsgriddijkstrashortest-path0-1-bfs
  • Data Structure DesignMediumAuto-graded
    Call-Signature Cache with Least-Recently-Used Eviction

    Simulate a fixed-capacity LRU cache keyed by a call's positional and keyword arguments, with order-insensitive, type-aware key matching.

    Data Structure Designlru-cachehash-mapdoubly-linked-listcanonical-keys
  • StringsEasyAuto-graded
    Max Length Product of Non-Overlapping Disjoint-Alphabet Substrings

    Find the maximum product of lengths of two non-overlapping substrings that do not share any characters.

    Stringsstringsmath-bitsarrays
  • Data Structure DesignMediumAuto-graded
    Thread-Safe Inventory Management

    Simulate concurrent inventory purchases and sales ensuring atomic state updates, preventing negative inventory, and handling invalid operations cleanly.

    Data Structure Designdesign-dsarraysconcurrency
  • Heaps, Sorting & SearchEasyAuto-graded
    Combine and Sort Two Unordered Integer Sequences

    Merge two unordered arrays of integers into a single list arranged in non-decreasing order.

    Heaps, Sorting & Searchsortingarraysfundamentals
  • Greedy & IntervalsEasyAuto-graded
    Does a New Booking Collide With Existing Slots?

    Decide whether a proposed half-open time slot shares any time with a list of unsorted booked slots, testing overlap logic and correct handling of touching endpoints.

    Greedy & Intervalsintervalsoverlaphalf-openlinear-scan
  • Heaps, Sorting & SearchMediumAuto-graded
    Kth Biggest Value Across a Pair of Ascending Lists

    Find the kth largest value in the union of two ascending integer lists, counting duplicates, ideally using binary search on a partition instead of a full merge.

    Heaps, Sorting & Searchbinary-searchsorted-arraysorder-statisticstwo-arrays
  • Trees & GraphsHardAuto-graded
    Most Distinct Values After Shifting Each Element

    Choose one shift per element from a given list to maximize distinct results; tests recognizing the problem as bipartite matching and implementing Hopcroft-Karp efficiently.

    Trees & Graphsbipartite-matchinghopcroft-karpgraphsgreedy-pitfalls
  • Stacks & QueuesMediumAuto-graded
    Longest Well-Formed Bracket Run

    Find the length of the longest contiguous well-formed stretch in a string of only round brackets, testing stack-based index tracking and handling of unmatched characters.

    Stacks & Queuesstackstringparenthesestwo-pass
  • Dynamic ProgrammingMediumAuto-graded
    Check Palindrome Transformation Within K Removals

    Determine if a given string can be converted into a palindrome by removing at most k characters.

    Dynamic Programmingdynamic-programmingstringsbit-manipulation
  • Heaps, Sorting & SearchMediumAuto-graded
    Order Trading Strategies by Chance of a Positive Day

    Rank strategies by the chance of a positive next-day return, using a predictive spread that includes both daily volatility and uncertainty in the estimated mean.

    Heaps, Sorting & Searchsortingstatisticscustom-keyprobability
  • Math & Bit ManipulationEasyAuto-graded
    Exact Binomial Probability of Coin Flips

    Calculates the exact binomial probability of obtaining a specific number of heads across a series of fair coin tosses.

    Math & Bit Manipulationmathprobabilitycombinatorics
  • Heaps, Sorting & SearchHardAuto-graded
    Priority Task Scheduler with Tag Filtering and Splicing

    Schedule tasks subject to dependency constraints, priority ordering, tag-based task filtering with dependency splicing, and cycle detection.

    Heaps, Sorting & Searchheaps-sortingtrees-graphstopological-sort
  • Math & Bit ManipulationEasyAuto-graded
    Calculate Progressive Income Tax in Cents

    Determine progressive income tax in cents given bracket thresholds and percentage rates using integer math.

    Math & Bit Manipulationmatharrayssimulation
  • Greedy & IntervalsMediumAuto-graded
    Text Formatting and Dynamic Schedule Tracker

    Perform greedy text wrapping to fixed line widths alongside dynamic interval point queries with insertion and removal.

    Greedy & Intervalsgreedyintervalsfenwick-treecoordinate-compression
  • Heaps, Sorting & SearchMediumAuto-graded
    Unique Union of Several Pre-Sorted Lists

    Combine many ascending integer lists into one ascending list with each distinct value appearing once, ideally using a heap-based k-way merge.

    Heaps, Sorting & Searchheapk-way-mergededuplicationsorted-arrays
  • Data Structure DesignMediumModel answer
    Log Test Executions and Query Failure Recovery and Concurrent Failures

    Design an event-driven system to track test statuses, calculate minimum recovery durations, and identify the longest continuous window of high concurrent failures.

    Data Structure Designdesign-dsgreedy-intervalsarrays
  • Greedy & IntervalsMediumAuto-graded
    Calculate Max Trading Returns from Multi-Asset Feed

    Process an unordered multi-asset market feed to find the maximum possible cumulative profit across all tickers.

    Greedy & Intervalsarraysgreedysortinghash-map
  • Data Structure DesignHardAuto-graded
    State-Driven Job Scheduler with DLQ and Dependencies

    Simulate an event-driven task queue handling execution states, lease timeouts, retry budgets, dependencies, and dead-letter cascading.

    Data Structure Designdesign-dsheaps-sortingtrees-graphsstacks-queues
  • StringsMediumAuto-graded
    Score a Guess Against a Hidden Word with Exact and Shifted Hits

    Compute exact-position and misplaced letter counts between a guess and a secret using leftover letter counts, with a sentinel for guesses missing from the word list.

    Stringsstringshashingfrequency-countingsimulation
  • Heaps, Sorting & SearchMediumAuto-graded
    Maximum Concatenation of Nonnegative Integers

    Order a list of nonnegative integers so that joining their decimal forms gives the biggest possible number, using a pairwise concatenation comparator and handling the all-zero case.

    Heaps, Sorting & Searchsortingcustom-comparatorstringsgreedy
  • Arrays & HashingEasyAuto-graded
    Increment Large Integer Represented as Digits

    Process an array of decimal digits representing a non-negative integer by adding one, correctly handling carry propagation and list expansion.

    Arrays & Hashingarraysmath-bitseasy
  • Heaps, Sorting & SearchMediumModel answer
    Design a Single-Threaded Delayed Task Runner

    Implement a priority-queue task runner that handles delayed execution without busy-waiting.

    Heaps, Sorting & Searchheappriority-queuedesign-dstime-complexity
  • Arrays & HashingEasyAuto-graded
    Activity Windows from Sensor Readings Over a Cutoff

    Scan sorted timestamped sensor readings once and group consecutive readings strictly above a cutoff into [first_time, last_time] windows.

    Arrays & Hashingarraystwo-pointersintervalssimulation
  • Arrays & HashingMediumAuto-graded
    Firebreak Choice in a Spreading Crop Disease Grid

    Simulate a synchronous grid disease model with delayed death or recovery, then try every single-row or single-column firebreak to minimize dead plants.

    Arrays & Hashingsimulationgridbrute-forcecellular-automaton
  • Arrays & HashingMediumAuto-graded
    Calculate Welch's T-Test P-Value for Experiment Rides

    Process user experiment assignments and ride telemetry data to calculate a Welch's two-sample t-test p-value under strict filtering rules.

    Arrays & Hashingstatisticsdata-processinghypothesis-testing
  • Greedy & IntervalsEasyAuto-graded
    Extract Continuous Active Time Windows

    Process chronological sensor sample logs to extract continuous active periods matching a minimum elapsed duration requirement.

    Greedy & Intervalsgreedy-intervalsarraystwo-pointers
  • Greedy & IntervalsMediumAuto-graded
    Wildcard 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
  • Heaps, Sorting & SearchMediumModel answer
    Design and Analyze an Intentionally Inefficient Correct Sorting Algorithm

    Propose a fully correct yet highly inefficient sorting algorithm, prove its termination and correctness, and derive its time and space complexity.

    Heaps, Sorting & Searchsortingcomplexity-analysiscombinatoricsrecursion
  • Heaps, Sorting & SearchMediumAuto-graded
    Weighted Distribution Sampling from Uniform Draws

    Validate probability weights and map pre-generated uniform float values to discrete outcomes using prefix sums and binary search.

    Heaps, Sorting & Searcharraysbinary-searchmathvalidation