KatInterview

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

Coding Interview Problems

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

5993
Problems
2220
Auto-graded
15
Topics
270
Added today

Showing 2341–2370 of 2771 results

  • Data Structure DesignMediumModel answer
    Build a Policy Engine for Expense Validation

    Create a rule evaluation system that checks expense submissions against JSON-defined policies without deploying new code.

    Data Structure Designdata-structuresparsingvalidation
  • Arrays & HashingMediumAuto-graded
    Count Close Point Pairs Within Distance Threshold

    Efficiently count pairs of points where both coordinate differences are at most 2, testing hash-based spatial grouping with duplicate handling.

    Arrays & Hashingarrayshashinggeometrycombinatorics
  • Trees & GraphsMediumAuto-graded
    Count Separate Land Regions in a Grid

    Tests flood-fill traversal to identify connected components in a 2D grid with four-directional adjacency.

    Trees & Graphsgraphsbfsdfsconnected-components
  • Data Structure DesignMediumModel answer
    Data Structure Selection: Complexity and Trade-offs

    Analyze time and space complexity for standard data structures and explain when to use each based on access patterns and constraints.

    Data Structure Designdata-structurescomplexity-analysistrade-offs
  • Dynamic ProgrammingMediumAuto-graded
    Tile a Word Using a Vocabulary List

    Tests whether a candidate can apply forward-reachability DP with a trie to decide if a string can be fully covered by vocabulary words end-to-end.

    Dynamic Programmingdynamic-programmingstringstrie
  • StringsMediumAuto-graded
    Maximum Unique Character Window

    Tests sliding window technique with hash map to track character positions and find the longest contiguous segment with all distinct characters.

    Stringssliding-windowhash-maptwo-pointers
  • Arrays & HashingMediumAuto-graded
    Organize Matrix Rings by Sorting Perimeters

    Tests matrix traversal and boundary extraction by sorting each rectangular ring of a matrix independently in clockwise order.

    Arrays & Hashingmatrixtraversalsorting
  • Arrays & HashingMediumAuto-graded
    Count Occurrences in Fixed-Size Subarrays

    Tests efficient sliding window maintenance to track element frequency across consecutive fixed-length subarrays.

    Arrays & Hashingsliding-windowarrayfrequency-counting
  • Data Structure DesignMediumModel answer
    Complete Concrete Classes in an Abstract Base Hierarchy

    Implement missing methods in concrete subclasses that inherit from abstract base classes while maintaining type safety and LSP compliance.

    Data Structure Designobject-oriented-designinheritanceabstractiondesign-patterns
  • Arrays & HashingEasyAuto-graded
    Qualifying Run Detector in a Timestamped Event Log

    Tests whether a candidate can scan a sorted event log in one pass to count maximal same-type runs that meet minimum length and duration thresholds.

    Arrays & Hashingarrayssliding-windowsimulation
  • Arrays & HashingEasyAuto-graded
    Clone a List with Index-Based Cross References

    Tests your ability to perform a deep copy of a nested list structure while preserving integer-indexed references between elements.

    Arrays & Hashingarraysdeep-copylist-manipulation
  • Greedy & IntervalsMediumAuto-graded
    Task Scheduler with Cooldown Periods

    Tests greedy scheduling with frequency counting to compute minimum execution time under per-task-type cooldown constraints.

    Greedy & Intervalsgreedyfrequency-countingscheduling
  • Data Structure DesignMediumAuto-graded
    Flatten and Filter a Nested Configuration Tree

    Tests the ability to write an iterator-style traversal over arbitrarily nested dicts and lists to extract leaf values matching a type filter.

    Data Structure Designdata structuresrecursioniteratorsnested data
  • Math & Bit ManipulationEasyAuto-graded
    Unit Sales Target After Fixed Cost Increase

    Tests cost-volume-profit analysis by computing last period's profit and the sales volume needed to maintain that profit when fixed costs rise.

    Math & Bit Manipulationmathbusiness-logicformulas
  • Arrays & HashingEasyAuto-graded
    Align Temperature Readings with Prior Humidity Data

    Tests ability to perform temporal joins on sorted time-series data with per-key state tracking and careful timestamp comparison.

    Arrays & Hashingtime-seriestwo-pointershash-table
  • Data Structure DesignMediumAuto-graded
    Simulate a Price-Level Tracker for Buy and Sell Orders

    Tests your ability to combine a hash map with a lazy-deletion heap to track best bid and ask prices across a sequence of order book operations.

    Data Structure Designheaphash-maplazy-deletionsimulation
  • Greedy & IntervalsMediumAuto-graded
    Balance Wealth Through Optimal Integer Transfers

    Tests greedy two-pointer coordination and integer division to equalize values with minimal movement.

    Greedy & Intervalsgreedytwo-pointersmathsimulation
  • Greedy & IntervalsMediumAuto-graded
    Minimum Transfers to Rebalance a Four-Zone Warehouse

    Tests whether you can compute the minimum number of item relocations to rebalance inventory across four warehouse zones using surplus/deficit reasoning.

    Greedy & Intervalsgreedyarraysoptimization
  • Arrays & HashingMediumAuto-graded
    Minimum Round-Trip Cost with Ordered Dates

    Tests prefix-minimum optimization to select two array indices under ordering constraints while minimizing their combined cost.

    Arrays & Hashinggreedyprefix-minimumarray-optimization
  • Dynamic ProgrammingHardModel answer
    Balance Mixed Bracket Types with Minimum Deletions

    Delete the fewest bracket characters to make all remaining brackets properly matched and nested, keeping all non-bracket characters intact.

    Dynamic Programmingdynamic-programmingstringsinterval-dp
  • Heaps, Sorting & SearchMediumAuto-graded
    Select K Elements with Highest Occurrence Count

    Tests frequency counting with hash maps and efficient selection of top elements using heap-based algorithms.

    Heaps, Sorting & Searchhash-mapheapcountingfrequency-analysis
  • Data Structure DesignMediumModel answer
    Build a Flexible Tennis Game Score Tracker

    Create a scoring system for a single tennis game that records points, displays readable scores, detects game completion, and supports multiple rule variants.

    Data Structure Designobject-oriented-designstrategy-patternstate-management
  • Arrays & HashingHardAuto-graded
    Group Activity Logs into Time-Based Sessions

    Tests time-series grouping, datetime arithmetic, gap-based segmentation, and aggregation with distinct counts.

    Arrays & Hashingtime-seriesgroupingdatetimeaggregation
  • Data Structure DesignMediumModel answer
    Lottery Bucket with Constant-Time Operations and Duplicates

    Build a data structure supporting O(1) add, remove, and uniform random selection where duplicate entries are treated as separate items.

    Data Structure Designhash-tablearrayrandomizationduplicates
  • Data Structure DesignMediumModel answer
    Hierarchical Task Tracker: OO Domain Model & Service Layer

    Design and implement an object-oriented model for a nested task manager with status propagation, recursive deletion, and attribute-based filtering.

    Data Structure Designobject-oriented designtree traversalAPI designcomposite pattern
  • Heaps, Sorting & SearchMediumAuto-graded
    Find Path with Highest Bottleneck Value in Grid

    Tests combining priority-queue graph traversal with bottleneck optimization to find the path whose minimum cell value is maximized.

    Heaps, Sorting & Searchgraph-traversaldijkstrabinary-searchunion-find
  • Data Structure DesignMediumModel answer
    Dense-Index Data Structure Code Review

    Review a structure storing items under contiguous integer keys with O(1) random selection and removal while preserving index density.

    Data Structure Designcode-reviewdata-structuresrandomizationcomplexity-analysis
  • Data Structure DesignMediumModel answer
    Greedy Card Selection with Dynamic Deck State

    Simulate a threshold-based card selection strategy that accounts for a shrinking deck, tracking which cards remain available after each decision.

    Data Structure Designfenwick-treegreedysimulationbinary-indexed-tree
  • Trees & GraphsMediumAuto-graded
    Collect Binary Tree Node Values in Left-Root-Right Order

    Tests binary tree traversal using an explicit stack to visit nodes in left-root-right sequence from a level-order serialized input.

    Trees & Graphsbinary-treetraversalstackdeserialization
  • Heaps, Sorting & SearchMediumAuto-graded
    Running Median with Power-of-Two Bucket Tracking

    Tests two-heap streaming median maintenance combined with exact integer floor-log₂ bucketing to place each median into its enclosing power-of-two interval.

    Heaps, Sorting & Searchheapsmedianbit-manipulation