KatInterview

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

Coding Interview Problems

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

6016
Problems
2229
Auto-graded
15
Topics
274
Added today

Showing 1351–1380 of 2128 results

  • Arrays & HashingMediumAuto-graded
    Alternating Chain Assembly from Both Ends

    Tests two-pointer simulation with alternating turns, conditional greedy selection rules, tie-breaking logic, and strict-increase constraints.

    Arrays & Hashingsimulationtwo-pointersarrays
  • Data Structure DesignHardAuto-graded
    IP Access Control with CIDR Matching

    Tests binary trie implementation for efficient IP prefix matching with CIDR notation and rule subsumption optimization.

    Data Structure Designtriebit-manipulationnetwork-programming
  • Trees & GraphsMediumAuto-graded
    Convert Nested Dictionary to Dot-Separated Keys

    Tests ability to traverse nested data structures and transform hierarchical key-value pairs into a flat representation using path notation.

    Trees & Graphsrecursioniterationdictionarytree-traversal
  • Arrays & HashingHardAuto-graded
    Difference-in-Differences Estimator with Baseline Gap Check

    Tests understanding of causal inference mechanics by computing a DID treatment effect and flagging baseline imbalance from panel observations.

    Arrays & Hashingcausal-inferencedata-analysisdifference-in-differences
  • Heaps, Sorting & SearchMediumAuto-graded
    Binary Search Over Date-Filtered Content Flags

    Tests whether a candidate can isolate records by category and then apply binary search to efficiently locate all entries within an inclusive date window.

    Heaps, Sorting & Searchbinary-searchsortingdata-manipulation
  • Math & Bit ManipulationMediumAuto-graded
    Frequency Peaks and Prime Extraction

    Tests frequency counting with tie-aware mode detection and prime identification via sieve, including edge cases for unique values and non-prime inputs.

    Math & Bit Manipulationhash-mapsieve-of-eratosthenesfrequency-counting
  • Arrays & HashingHardAuto-graded
    Data-Driven Fare Policy Rule Engine

    Evaluate stored fare and per-driver policy rules over a trip table with generic field/operator conditions and exact integer-cent sums.

    Arrays & Hashinghash-mapsortingrule-enginesimulation
  • Arrays & HashingMediumAuto-graded
    Transform a Sorted Array with a Quadratic

    Evaluate a quadratic expression at every element of a sorted array and emit the results in ascending order in linear time.

    Arrays & Hashingtwo-pointerssortingmathmonotonic
  • StringsEasyAuto-graded
    Cluster Words by Letter Inventory

    Tests whether you can use a canonical character-frequency key and a hash map to partition a list of strings into anagram groups in linear time.

    Stringshash-mapstringsanagrams
  • Data Structure DesignMediumAuto-graded
    Parcel Attribute Store with TTL and Prefix Queries

    Simulate a timestamped key-value attribute store with overwrite, conditional update, sorted prefix listing, and per-attribute expiry.

    Data Structure Designhash-mapsimulationsortingexpiry
  • Arrays & HashingHardAuto-graded
    All MEX Values After One Optional Increment

    Find every possible MEX after incrementing at most one array element by 1, respecting an upper-bound constraint.

    Arrays & Hashingarraysgreedymathcase-analysis
  • Arrays & HashingEasyAuto-graded
    Count Strictly Rising Signal Windows

    Count how many contiguous subarrays of length exactly k have strictly increasing values in a signal array.

    Arrays & Hashingarrayssliding-windowcounting
  • Data Structure DesignMediumAuto-graded
    Replayable Library Lending Operations

    Simulate a book catalog with case-insensitive title/author search and atomic borrow/return state transitions replayed from an operation log.

    Data Structure Designhash-mapsimulationstring-matchingstate-machine
  • Data Structure DesignHardAuto-graded
    Rolling-Window Chat Activity Tracker

    Build a bounded-memory sliding-window aggregator answering distinct-chat, distinct-user, and message-total queries from an operation log in amortized O(1).

    Data Structure Designsliding-windowdequehash-mapreference-counting
  • Arrays & HashingMediumAuto-graded
    Length of the Longest Run of Consecutive Integers

    Tests whether a candidate can find the longest chain of consecutive integers in an unsorted array in linear time using a hash set.

    Arrays & Hashinghash-setarrayssequences
  • Greedy & IntervalsMediumAuto-graded
    Count Active Surveillance Cameras at Each Minute

    Tests the sweep-line technique by computing, for each minute in a query list, how many camera recording intervals are active at that exact moment.

    Greedy & Intervalssweep lineintervalsgreedysorting
  • Heaps, Sorting & SearchMediumAuto-graded
    First Flagged Build in a Deployment Pipeline

    Tests whether a candidate can recognize a monotonic predicate and apply binary search to find the first transition point without comparing version strings.

    Heaps, Sorting & Searchbinary-searcharraysmonotonic-predicate
  • StringsEasyAuto-graded
    Count Single-Character Occurrences in a String

    Tests whether a candidate can scan a string and tally exact, case-sensitive matches for a given character, including edge cases like empty input and repeated characters.

    Stringsstringscountingcase-sensitivity
  • Data Structure DesignMediumAuto-graded
    Billing Reconciliation: Match Payments to Invoices in Three Stages

    Tests incremental lookup design by matching payments to invoices via explicit ID, then earliest-dated exact-amount fallback, then a forgiveness range, with closed-invoice tracking throughout.

    Data Structure Designhash-mapheapsegment-tree
  • Stacks & QueuesEasyAuto-graded
    Balanced Delimiter Validation with a Stack

    Decide whether a bracket-only string is properly nested and matched, using a LIFO stack of pending openers.

    Stacks & Queuesstackstringsparsing
  • Arrays & HashingMediumAuto-graded
    Longest Strictly Increasing Contiguous Run

    Tests whether a candidate can scan an array in a single linear pass to find the length of the longest strictly increasing contiguous run.

    Arrays & Hashingarrayssliding-windowgreedy
  • Trees & GraphsMediumAuto-graded
    Column-Ordered Tree Values From a Level-Order Array

    Bucket level-order tree nodes by column, then sort each column by depth and value to produce the grouped output.

    Trees & Graphsbinary-treebreadth-first-searchsortinghash-map
  • StringsMediumAuto-graded
    Reconstruct Digit Sequence from a Jumbled Letter Pool

    Tests whether a candidate can decode digit counts from a scrambled multiset of English number-word letters using systematic letter-frequency elimination.

    Stringsstringshash-mapgreedy-intervals
  • Arrays & HashingMediumAuto-graded
    Find Gaps in Traffic Segment Assignments

    Tests set-based membership filtering over a bounded integer range, with duplicate and out-of-bounds input handling.

    Arrays & Hashingsetsfilteringranges
  • Arrays & HashingMediumAuto-graded
    Check for Subarray Summing to Target

    Tests the ability to use prefix sums and a hash set to detect whether any contiguous slice of an array sums to a given value.

    Arrays & Hashingprefix-sumhash-setsubarray
  • Arrays & HashingMediumAuto-graded
    Locate Symbol-Structure Templates in a Number Grid

    Tests whether a candidate can slide a letter-template over an integer grid and detect every position where symbols and values form a valid one-to-one correspondence.

    Arrays & Hashinghash-mappattern-matchingmatrixisomorphism
  • Arrays & HashingHardAuto-graded
    Bayesian Coin Identification from Flip Observations

    Compute exact posterior probabilities over three weighted coins from a sequence of flips, plus the predictive probability the next flip is heads.

    Arrays & Hashingbayes-theoremprobabilityfractionsposterior-predictive
  • Data Structure DesignEasyAuto-graded
    Build a Fixed-Capacity Recency-Ordered Cache

    Tests whether you can design a cache that evicts the least-recently-touched entry in O(1) time using a hash map paired with an ordered structure.

    Data Structure Designhash-maplinked-listcacheOrderedDict
  • Data Structure DesignMediumAuto-graded
    Unified Entity Log with Mergeable ID Groups

    Tests ability to design a data structure that resolves multiple system-assigned IDs to a single entity and returns a chronologically merged observation history.

    Data Structure Designunion-finddesignsorting
  • Greedy & IntervalsEasyAuto-graded
    Budget Shopping from Array Suffix

    Tests greedy selection with precomputation, prefix sums, and binary search to maximize item counts under budget constraints.

    Greedy & Intervalsgreedybinary-searchprefix-sumsorting