KatInterview

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

Interview Practice Problems

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

6013
Problems
2228
Auto-graded
15
Topics
273
Added today

Showing 781–810 of 2228 results

  • 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
  • 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 & 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
  • Greedy & IntervalsEasyAuto-graded
    Summarize Integer Ranges into String

    Process an unorganized array of integers by sorting, deduplicating, and formatting contiguous numerical ranges into a compact string.

    Greedy & Intervalsarrayssortingintervalsstrings
  • Trees & GraphsEasyAuto-graded
    Collect Every File Path from a Nested Directory Tree

    Traverse a nested directory dictionary depth-first and build the full slash-joined path for each file, following precise joining and ordering rules.

    Trees & Graphsdfstree-traversalrecursionstrings
  • Arrays & HashingMediumAuto-graded
    Per-Unit Coupon Pricing with Half-Even Cent Rounding

    Total a shopping cart where each coupon discounts one unit of its item, with percent discounts rounded half-to-even in exact integer arithmetic.

    Arrays & Hashinghash-mapsimulationroundinginteger-math
  • Math & Bit ManipulationMediumAuto-graded
    Aggressive Wagering: Chance of Hitting the Goal Before Going Broke

    Model a state-dependent betting strategy as a Markov chain and solve absorption probabilities, including cycles, via a linear system.

    Math & Bit Manipulationprobabilitymarkov-chainlinear-algebragaussian-elimination
  • Arrays & HashingEasyAuto-graded
    Compute Post-Match Standardized Mean Differences

    Evaluate post-matching covariate balance by computing the absolute standardized mean difference across features.

    Arrays & Hashingstatisticsmath-bitsarrays
  • Math & Bit ManipulationEasyAuto-graded
    Calculate Product Mix Profitability Metrics

    Computes baseline and mix-shifted unit profit averages, per-unit margin delta, and overall impact on profit given total volume.

    Math & Bit Manipulationmatharrays
  • Data Structure DesignMediumAuto-graded
    Banned-Word Review Screener with Per-User Strike Counts

    Simulate a stateful screening service driven by an operation log: whole-token, case-insensitive banned-word checks, replaceable word lists, and per-user flagged-review tallies.

    Data Structure Designhash-sethash-mapsimulationstrings
  • Arrays & HashingEasyAuto-graded
    Rollout Impact: Diff-in-Diff Estimate with Baseline Drift Check

    Aggregate per-group, per-window means from daily records, compute a difference-in-differences estimate, and flag baseline drift between two pre-period sub-windows.

    Arrays & Hashinghashingaggregationstatisticsdate-windows
  • Heaps, Sorting & SearchMediumAuto-graded
    Determine the K-th Highest Score in an Unsorted Array

    Find the k-th largest value in an unsorted array of integers without fully sorting the input.

    Heaps, Sorting & Searcharrayssortingdivide-and-conquerquickselect
  • Arrays & HashingEasyAuto-graded
    Generate Cartesian Product of Search Space Parameters

    Construct all explicit configurations from a dictionary mapping parameter names to lists of candidate values using Cartesian product generation.

    Arrays & Hashingcartesian-productgeneratorarraysdictionary-manipulation
  • StringsEasyAuto-graded
    Count Case-Sensitive Occurrences in a Text

    Count how many times a target character, or substring, appears in a text under case-sensitive, non-overlapping matching.

    Stringsstringscountingsubstringcase-sensitive
  • Arrays & HashingMediumAuto-graded
    Find Most Overlapping Pair of Sets

    Find the pair of set keys with the highest intersection size, using Jaccard similarity and lexicographical order as tie-breakers via an inverted index approach.

    Arrays & Hashinginverted-indexhash-tablearraysstring
  • Trees & GraphsMediumAuto-graded
    Group Binary Tree Nodes into Vertical Columns

    Group nodes of a binary tree represented in array heap layout into vertical columns ordered from left to right.

    Trees & Graphstrees-graphsbreadth-first-searchbinary-treequeues
  • Trees & GraphsMediumAuto-graded
    Count Separate Land Masses in a Grid

    Evaluate grid graph connectivity by finding the number of distinct 4-directionally connected land components.

    Trees & Graphstrees-graphsdfs-bfsgrid
  • Data Structure DesignMediumAuto-graded
    Least Recently Used Storage Simulation

    Simulate a fixed-capacity Least Recently Used (LRU) storage engine that processes lookup and insert operations in O(1) time.

    Data Structure Designdesign-dslinked-listsarrays
  • Greedy & IntervalsMediumAuto-graded
    Collapse Booked Time Slots into Disjoint Blocks

    Combine a list of [start, end] ranges so that any that overlap or touch become one range, using sorting and a single sweep.

    Greedy & Intervalsintervalssortinggreedyarrays
  • Arrays & HashingMediumAuto-graded
    Grid Editor: Flip Rows, Swap Rows, and Turn Clockwise

    Simulate a sequence of string commands (row reversal, row swap, 90-degree clockwise turn) on a rectangular grid whose shape changes after each turn.

    Arrays & Hashingmatrixsimulationstring-parsingrotation
  • Heaps, Sorting & SearchMediumAuto-graded
    Find Frequent Elements with Custom Tie-Breaking

    Count item occurrences and retrieve the top k highest-frequency elements, sorting tied elements by value ascending.

    Heaps, Sorting & Searcharrayssortinghash-table
  • Arrays & HashingMediumAuto-graded
    Product of Two Mostly-Zero Grids

    Compute the product of two mostly-zero integer matrices by precomputing nonzero positions so that no work is spent on zero operands.

    Arrays & Hashingmatrixsparsesimulationhashing