KatInterview

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

Coding Interview Problems

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

6036
Problems
2235
Auto-graded
15
Topics
273
Added today

Showing 1141–1170 of 2788 results

  • Arrays & HashingEasyAuto-graded
    Overlap Ratio of Two Token Lists

    Compute the overlap ratio between the distinct strings of two lists using hash sets, with exact string matching and a defined result when both lists are empty.

    Arrays & Hashinghash-setsetsstringsedge-cases
  • Math & Bit ManipulationHardModel answer
    Comprehensive Algorithmic Practice Set: Bitwise, Window, Monotonic Stack & Tree Operations

    A practice collection covering essential algorithms: bit manipulation, two pointers, monotonic stack, dynamic programming, binary search, tree path XORs, and graph re-rooting.

    Math & Bit Manipulationbit-manipulationmonotonic-stacktree-dpdynamic-programming
  • Greedy & IntervalsEasyAuto-graded
    Find Peak Event Density in Fixed Duration Window

    Determine the maximum number of recorded logs occurring within a contiguous time interval using a sliding window approach.

    Greedy & Intervalssliding-windowtwo-pointersarraysintervals
  • Trees & GraphsMediumAuto-graded
    Hide Flagged Comment Threads for a Pet-Preference Reader

    Find all comments hidden from a reader when any flagged comment hides its whole reply subtree, handling unordered input, dangling parent IDs, and very deep chains.

    Trees & Graphstreedfshash-mapforest
  • Math & Bit ManipulationEasyAuto-graded
    Determine Convergence of Digit-Square Sums

    Simulate a transformation that replaces a number with the sum of its squared digits, determining if it terminates at 1 or loops indefinitely.

    Math & Bit Manipulationmathhash-tabletwo-pointers
  • StringsMediumAuto-graded
    Group Digits of a Signed Integer with a Custom Delimiter

    Build a string from a signed 64-bit integer, placing a delimiter between each group of three digits from the right, with the minus sign kept in front, using manual digit handling.

    Stringsstringsmathformattingdigit-extraction
  • Trees & GraphsMediumAuto-graded
    Alphabetical Job Scheduler with Prerequisite Rules

    Produce a full run order for jobs under prerequisite constraints, always picking the alphabetically smallest available job, or return an empty list if a cycle exists.

    Trees & Graphstopological-sortheapgraphkahn-algorithm
  • Heaps, Sorting & SearchMediumAuto-graded
    Locate K Nearest Values in a Sorted Sequence

    Binary search for the starting boundary of a contiguous k-element slice minimizing distance to a given target in a sorted list.

    Heaps, Sorting & Searchbinary-searchtwo-pointersarrays
  • Trees & GraphsMediumAuto-graded
    Vertical Column Grouping of Array-Represented Binary Trees

    Organize the elements of a binary tree into vertical columns using level-order traversal rules on a level-order array input.

    Trees & Graphstrees-graphsbreadth-first-searcharraysqueues
  • Data Structure DesignMediumModel answer
    Transit Fleet Simulator: Sampling, Seating Limits, and Fast-Lane Riders

    Build a bus network simulator: downsample riders by origin-destination pair, board and drop under a capacity cap, validate event logs, and give priority-pass riders precedence.

    Data Structure Designsimulationheapstratified-samplingevent-ordering
  • Data Structure DesignMediumAuto-graded
    Simulate a Tiny Hierarchical File Store from a Command Log

    Replay a command log against an in-memory directory tree, with auto-created parent folders, file appends, reads and sorted listings.

    Data Structure Designdesigntrietreehash-map
  • Arrays & HashingMediumAuto-graded
    Most Popular Three-Page Browsing Path Across Users

    Group visit logs by user, order them by time, and find the three-page ordered path shared by the most distinct users, with a lexicographic tie-break.

    Arrays & Hashinghashingsortingcombinationscounting
  • Trees & GraphsMediumAuto-graded
    Find k-th Subordinate in Cascade Traversal

    Find the k-th node reached during a preorder depth-first traversal of a specific node's subtree when children are visited in ascending numerical order.

    Trees & Graphstrees-graphsdfstree-traversal
  • Data Structure DesignMediumAuto-graded
    Hierarchical Storage Simulator with Auto-Renamed Duplicates

    Simulate an in-memory directory tree with auto-created folders, numbered duplicate file names that respect extensions, content lookup, and sorted listings.

    Data Structure Designdesignhash-mapstring-parsingsimulation
  • Trees & GraphsMediumModel answer
    Shared Ancestors: Binary Tree to Multi-Parent Graph

    Find the lowest common ancestor of two nodes in a binary tree, then generalize to a directed acyclic graph where several incomparable lowest common ancestors can exist.

    Trees & Graphslowest-common-ancestorbinary-treedagbfs
  • Trees & GraphsEasyAuto-graded
    Trace Path to Terminal Node or Cycle Entry

    Determine the final visited node when following single-successor directed edges until reaching a dead end or a previously visited node.

    Trees & Graphstrees-graphsarrayshash-table
  • Trees & GraphsMediumAuto-graded
    Can Every Task Be Scheduled Given Dependency Pairs?

    Tests modeling dependencies as a directed graph and detecting whether a cycle prevents a complete valid ordering, e.g. via indegree-based topological sorting.

    Trees & Graphsgraphtopological-sortcycle-detectionbfs
  • Greedy & IntervalsMediumAuto-graded
    Weekly Deploy Windows with Time Zones and Blackouts

    Convert weekly recurring allow and freeze windows from local time zones to UTC, subtract the freezes, and list the first usable slots after a notice period.

    Greedy & Intervalsintervalssweep-linetime-zonesmodular-arithmetic
  • Data Structure DesignHardAuto-graded
    Cache, Quota Gate and Burst Counter: Batch Operation Runner

    Simulate a batch of operations on an O(1) LFU cache, a fixed-window per-user quota check, and a two-pointer peak request counter.

    Data Structure Designlfu-cacheordered-dictrate-limitingtwo-pointers
  • Heaps, Sorting & SearchMediumAuto-graded
    Maximize Resource Harvest with Linear Depletion

    Find the maximum yield from extracting resources over K time steps when each extraction reduces a site's yield by 1 using binary search on the minimum threshold.

    Heaps, Sorting & Searcharraysheaps-sortinggreedy-intervalsmath-bits
  • Greedy & IntervalsMediumAuto-graded
    Metered Usage Bill with Special Rate Windows

    Compute a total bill over a half-open time window where disjoint special-rate windows replace the default hourly rate, testing interval clipping and boundary handling.

    Greedy & Intervalsintervalssweepmatharrays
  • Greedy & IntervalsMediumAuto-graded
    Analyze Schedule Capacity and Overlaps

    Evaluate interval concurrency to determine if single-resource scheduling is possible and calculate peak concurrent demand.

    Greedy & Intervalsintervalssortingheapsweep-line
  • Data Structure DesignMediumModel answer
    Design and Implement Connect Four with Game Logic and State Management

    Build a complete two-player Connect Four game on a 6x7 grid, including drop mechanics, win/draw state evaluation, edge-case prevention, and modular state architecture.

    Data Structure DesignArraysGame DesignState ManagementData Structures
  • Math & Bit ManipulationEasyAuto-graded
    Confusion Matrix Scorecard with Safe Division

    Compute precision, recall, specificity, F1 and accuracy from confusion-matrix counts, returning 0.0 for any metric whose denominator is zero.

    Math & Bit Manipulationmetricsconfusion-matrixedge-casesarithmetic
  • Data Structure DesignMediumModel answer
    Tuning a Multithreaded C++ Pipeline for Speed and Tail Latency

    Explain how you would profile and speed up an existing multithreaded C++ service whose thread pool and queue are given, covering memory, cache, contention, and verification.

    Data Structure Designcppperformanceconcurrencyprofiling
  • Data Structure DesignHardAuto-graded
    Interactive Time Calendar with Pagination and Range Queries

    Process dynamic interval updates, range queries, and ordered pagination operations efficiently.

    Data Structure Designtrees-graphsdesign-dsgreedy-intervals
  • Heaps, Sorting & SearchMediumAuto-graded
    Merge Multiple Sorted Series with Grouping

    Efficiently merge K pre-sorted event logs while combining entries sharing identical timestamps.

    Heaps, Sorting & Searchheaps-sortingarraystwo-pointers
  • Math & Bit ManipulationEasyAuto-graded
    Probability of Keeping Majority Red Items

    Calculates the probability that at least two of three kept items are red when green items are returned upon selection.

    Math & Bit Manipulationmathcombinatoricsprobability
  • Arrays & HashingHardAuto-graded
    Calculate Expected Roll Counts for Target Dice Sequences

    Evaluate expected values for geometric process waiting times and pattern completion using Markov chain state transitions.

    Arrays & Hashingprobabilityexpected-valuemarkov-chainscombinatorics
  • Arrays & HashingEasyAuto-graded
    Find Minimum and Mode of an Integer Array

    Find the minimum element and the most frequent element (mode) in an unsorted list of integers.

    Arrays & Hashingarrayshash-tablefrequency-counting