KatInterview

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

Coding Interview Problems

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

6003
Problems
2223
Auto-graded
15
Topics
273
Added today

Showing 1561–1590 of 2123 results

  • Greedy & IntervalsMediumAuto-graded
    Find the Highest-Scoring Boundary Pair in an Array

    Tests whether a candidate can exploit a telescoping sum identity to reduce an interval scoring problem to a fast two-endpoint selection with careful tie-breaking.

    Greedy & Intervalsarraysgreedytwo-pointers
  • Stacks & QueuesMediumAuto-graded
    Bracket Matching, Interval Union, and Expression Parsing

    Tests stack-based bracket validation, interval merging with endpoint semantics, and arithmetic evaluation with unary operators.

    Stacks & Queuesstacksintervalsparsingexpression-evaluation
  • Arrays & HashingMediumAuto-graded
    R² Bounds When Two Predictors Are Combined in OLS

    Tests whether a candidate can derive the valid range of R² for a joint OLS model given the individual R² values of two single-predictor models.

    Arrays & HashingstatisticsregressionOLS
  • Arrays & HashingHardAuto-graded
    Cost-Aware Fraud Model Comparison

    Compares classification models using business costs, derives optimal decision thresholds, and identifies the most economical model.

    Arrays & Hashingclassificationcost-sensitive-learningconfusion-matrixmodel-evaluation
  • Dynamic ProgrammingMediumAuto-graded
    Maximum Score With No Two Adjacent Drops

    Tests whether a candidate can model a pick/skip DP with a "no two consecutive skips" constraint using O(1) space and O(n) time.

    Dynamic Programmingdynamic-programmingarraysgreedy
  • Arrays & HashingMediumAuto-graded
    Pair Indices with Given Sum

    Tests hash table usage and algorithm optimization to locate two array positions that sum to a target value.

    Arrays & Hashinghash-maptwo-pointersoptimization
  • StringsMediumAuto-graded
    Check Password Compliance and Report Violations

    Tests string validation logic, character classification, case-insensitive pattern matching, and consecutive character counting.

    Stringsvalidationstring-processingpattern-matching
  • Heaps, Sorting & SearchMediumAuto-graded
    Top-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-graded
    Find 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
  • Trees & GraphsHardAuto-graded
    Minimum Moves Across an Obstacle Grid

    Tests BFS-based shortest-path reasoning on an unweighted 2D grid with blocked cells and 4-directional movement.

    Trees & Graphsbfsgraph traversalgridshortest path
  • Arrays & HashingMediumAuto-graded
    Filter Bank Transfers and Summarize by Source Account

    Tests ability to validate records against a lookup table, apply multi-condition filtering, and aggregate results into ranked frequency counts.

    Arrays & Hashingsimulationhash-mapsorting
  • Data Structure DesignHardAuto-graded
    Multicore Thermal Simulation with Adaptive Cooling Selection

    Tests discrete-event simulation skills: delayed load semantics, proportional passive cooling with vibration penalties, fixed-point active cooling selection, and transition-only status reporting.

    Data Structure Designsimulationstate-machinefixed-point
  • Arrays & HashingMediumAuto-graded
    Text Spam Detector: Naive Bayes Classifier with F1 Score

    Tests understanding of probabilistic text classification by implementing a Multinomial Naive Bayes model from scratch and evaluating it with the F1 score.

    Arrays & Hashingnaive-bayestext-classificationf1-score
  • Arrays & HashingEasyAuto-graded
    Count Unique Elements in Array

    Identify how many values appear exactly one time in an integer array using frequency analysis.

    Arrays & Hashinghash-tablecountingfrequency-map
  • StringsMediumAuto-graded
    Sliding Tokens: Valid String Transformation

    Tests two-pointer traversal, sequence invariants, and directional movement constraints with O(n) time and O(1) space.

    Stringstwo-pointersgreedyinvariants
  • Dynamic ProgrammingHardAuto-graded
    Count Parity-Alternating Subsequences

    Tests dynamic programming with state tracking to count subsequences where consecutive elements alternate between even and odd values.

    Dynamic Programmingdynamic-programmingsubsequencesparitymodular-arithmetic
  • Data Structure DesignHardAuto-graded
    N-Player High-Card Showdown: Simulate and Score

    Tests object-style thinking, round-robin dealing, and deterministic simulation of a card game where each round's highest card wins all played cards.

    Data Structure Designsimulationqueuesgame-design
  • Greedy & IntervalsMediumAuto-graded
    Identify Gaps in a Sorted Array Within Bounds

    Tests interval reasoning, array traversal, edge case handling with boundaries, and formatting output for missing number ranges.

    Greedy & Intervalsarraysintervalsedge-cases
  • Arrays & HashingEasyAuto-graded
    Splice One Sequence Into Another by Index Range

    Tests careful list slicing and index boundary handling by replacing a contiguous subrange of one sequence with the full contents of a second sequence.

    Arrays & Hashingarraystwo-pointersimplementation
  • Arrays & HashingMediumAuto-graded
    Convolutional Layer Analysis: Shapes, Parameters, and Efficiency

    Calculate output dimensions, parameter counts, and multiply-accumulate operations for standard and depthwise separable convolutions.

    Arrays & Hashingconvolutional-networksparameter-countingcomputational-complexity
  • Data Structure DesignHardAuto-graded
    TTL-Aware LRU Cache with Lazy Expiration

    Tests ability to design an O(1) key-value store combining LRU eviction with per-entry time-to-live expiration using a hash map and doubly linked list.

    Data Structure Designlinked-listshash-mapcachelru
  • Data Structure DesignEasyAuto-graded
    Replay an Operation Log to Answer Versioned Key Lookups

    Tests the ability to simulate a versioned key-value store by replaying a sequence of set/delete operations and answering point-in-time key lookups.

    Data Structure Designdata structuressimulationhash map
  • Data Structure DesignMediumAuto-graded
    Simulate LRU Cache with Composite Keys

    Tests understanding of LRU eviction policy, composite key normalization, and cache statistics tracking through command simulation.

    Data Structure Designlru-cachehashingordered-dictdata-structures
  • Stacks & QueuesMediumAuto-graded
    Trim a Bracket String to Its Longest Balanced Form

    Tests stack-based bracket matching: find and remove the fewest characters from a parentheses-only string to leave a fully balanced result.

    Stacks & Queuesstacksstringsgreedy
  • Arrays & HashingMediumAuto-graded
    Sorted Array: All Unique Pairs With a Given Sum

    Tests whether a candidate can apply the two-pointer pattern on a sorted array to collect every distinct value pair that adds up to a target, without emitting duplicates.

    Arrays & Hashingtwo-pointerssortingdeduplication
  • Arrays & HashingMediumAuto-graded
    Paginate and Budget-Trim a Chat History

    Assemble a chronological transcript from paginated data, then reduce it to fit a token limit by removing the earliest messages.

    Arrays & Hashingpaginationsliding-windowsimulation
  • Trees & GraphsMediumAuto-graded
    Recursive Schema Validation

    Tests recursive validation of nested dictionaries against a schema with type and presence requirements.

    Trees & Graphsrecursionvalidationnested-structures
  • StringsEasyAuto-graded
    Fixed-Width Substitution Cipher: Encode and Decode

    Tests your ability to apply character-to-code substitution and reverse it using an inverted dictionary for O(1) chunk lookups.

    Stringsstringshash-mapsimulation
  • Stacks & QueuesMediumAuto-graded
    Identify Invalid Parentheses for Removal

    Tests stack-based matching to find the minimum set of parenthesis indices that must be removed to balance a string.

    Stacks & Queuesstackstring-processinggreedy
  • Linked ListsMediumAuto-graded
    Singly Linked List Symmetry Check (Non-Destructive)

    Tests whether a candidate can verify palindrome structure on a singly linked list in O(n) time and O(1) space while restoring every pointer before returning.

    Linked Liststwo-pointerslinked-listsin-place