KatInterview

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

Interview Practice Problems

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

5986
Problems
2219
Auto-graded
15
Topics
271
Added today

Showing 1921–1950 of 2219 results

  • Data Structure DesignEasyAuto-graded
    Gem Purchase Simulator with Color-Based Discounts

    Tests stateful simulation with resource tracking, discount accumulation, and transactional updates.

    Data Structure Designsimulationstate-managementhash-map
  • Stacks & QueuesHardAuto-graded
    Final Sale Prices with Discount Tracking

    Tests monotonic stack usage to efficiently find next smaller-or-equal elements and aggregate results with index tracking.

    Stacks & Queuesmonotonic-stackarraysaggregation
  • Math & Bit ManipulationMediumAuto-graded
    Anti-Diagonal Cell in Outward Spiral Matrix

    Finding a specific value in a spiral-filled matrix using mathematical properties of concentric rings rather than simulation.

    Math & Bit Manipulationmatrixspiralmathclosed-form
  • SQL & DataMediumAuto-graded
    Aggregating Safety and Activity Metrics Across Multiple Entities

    Tests proficiency in multi-table aggregation, ratio computation, windowed moving averages, and handling edge cases with missing data.

    SQL & Dataaggregationjoinswindow-functionsdata-analysis
  • Greedy & IntervalsMediumAuto-graded
    Minimum Paint Strokes to Cover a Board

    Tests the ability to merge overlapping intervals greedily to find the fewest horizontal paint strokes needed to fully cover a set of colored segments on a 1-D board.

    Greedy & Intervalsgreedyintervalssorting
  • Math & Bit ManipulationMediumAuto-graded
    Desert Transport: Maximum Cargo Delivery with Consumption Cost

    Tests piecewise optimization and depot strategy when a vehicle with limited capacity must transport goods while consuming resources proportional to distance traveled.

    Math & Bit Manipulationoptimizationmathgreedysimulation
  • StringsMediumAuto-graded
    Maximum Substring Length with Character Limit

    Tests sliding window technique to find the longest contiguous sequence where the number of unique characters does not exceed a threshold.

    Stringssliding-windowhash-maptwo-pointers
  • Greedy & IntervalsMediumAuto-graded
    Schedule Maximum Jobs Before Their Deadlines

    Tests greedy scheduling with deadlines: select the maximum number of unit-length jobs, each with a profit and deadline, maximizing total profit within deadline slots.

    Greedy & Intervalsgreedyschedulingintervalssorting
  • Trees & GraphsHardAuto-graded
    Minimum Cost Route with Limited Layovers

    Tests understanding of constrained shortest-path algorithms on directed weighted graphs with edge-count restrictions.

    Trees & Graphsgraphsshortest-pathbellman-fordconstraints
  • Data Structure DesignHardAuto-graded
    Track the Earliest Single-Occurrence Integer in a Stream

    Design a structure that efficiently identifies the first integer appearing exactly once in a dynamic sequence of integers.

    Data Structure Designqueuehash-tabledata-structure-design
  • Arrays & HashingHardAuto-graded
    Compute P-Values for Statistical Hypothesis Tests

    Tests numerical stability in tail probability calculation, distribution function implementation, and handling of hypothesis testing edge cases.

    Arrays & Hashingstatisticsnumerical-methodshypothesis-testing
  • StringsHardAuto-graded
    Parse Token Components Without External Libraries

    Tests manual implementation of Base64URL decoding and understanding of multi-part token structure with bit-level encoding.

    Stringsencodingparsingbit-manipulation
  • Arrays & HashingMediumAuto-graded
    Find Contiguous Prefix Values in Permutation

    Tests understanding of positional reasoning and incremental range tracking in permutations to identify when values 1..k occupy consecutive indices.

    Arrays & Hashingarrayspermutationssliding-windowgreedy
  • Arrays & HashingMediumAuto-graded
    Straight-Line Word Search Across Eight Directions

    Tests whether a target word appears in a letter grid along any single unbroken ray, locking direction after the first letter.

    Arrays & Hashinggridstring-matchingenumeration
  • Trees & GraphsMediumAuto-graded
    Minimum Steps in Word Ladder

    Tests BFS on an implicit graph with efficient neighbor generation using wildcard pattern indexing.

    Trees & Graphsbfsgraphstringhashing
  • Data Structure DesignMediumAuto-graded
    Multi-Component Data Processing Challenge

    Tests array merging from the back, queue-based task scheduling with time slices, and price-level order matching in a simulated trading book.

    Data Structure Designarraysqueuessimulation
  • Data Structure DesignMediumAuto-graded
    Task Assignment System with Expiration Windows

    Tests in-memory data modeling, time-based state management, priority queuing, and handling overlapping task assignments with TTL semantics.

    Data Structure Designobject-oriented-designtime-based-logicdata-structures
  • Arrays & HashingMediumAuto-graded
    Find Minimum Window Containing All Distinct Characters

    Tests ability to use a sliding window combined with hash counting to find the shortest substring that contains every distinct character appearing in the input string.

    Arrays & Hashingsliding windowhash mapstringstwo pointers
  • Greedy & IntervalsMediumAuto-graded
    Maximum Placement with Spacing Constraints

    Tests greedy iteration with adjacency rules, requiring precise edge-case handling and index management.

    Greedy & Intervalsgreedyarraysiteration
  • Dynamic ProgrammingHardAuto-graded
    Minimum Cost to Multiply a Chain of Matrices

    Tests interval dynamic programming by finding the least expensive way to parenthesize consecutive matrix multiplications.

    Dynamic Programminginterval-dpoptimizationmemoization
  • SQL & DataEasyAuto-graded
    Social Media Reply Analytics

    Analyzes reply patterns in social media data using temporal filtering, joins, and aggregation to compute engagement metrics.

    SQL & Datadata-analysisaggregationfiltering
  • Math & Bit ManipulationMediumAuto-graded
    Convert Absolute-Value Penalty to Linear Program Constraints

    Transform a portfolio optimization model with absolute-value transaction costs into standard linear programming form using auxiliary variables.

    Math & Bit Manipulationlinear-programmingoptimizationmathematical-modeling
  • Arrays & HashingMediumAuto-graded
    Longest Subarray with Bounded Variance Sum

    Tests the ability to combine prefix sums with hash maps to efficiently find the longest contiguous subarray whose element-wise difference from the mean of two boundary values stays within a given tolerance.

    Arrays & Hashingarraysprefix sumshash maps
  • Math & Bit ManipulationEasyAuto-graded
    Count Animals from Legs and Population Ratios

    Tests setting up and solving a system of linear equations with fixed ratios between variables.

    Math & Bit Manipulationalgebralinear-equationsconstraint-satisfaction
  • SQL & DataMediumAuto-graded
    Deduplicate and Reconcile Customer Records

    Tests the ability to clean a list of messy customer records by deduplicating on a canonical key, resolving field conflicts with explicit priority rules, and returning a sorted, normalized result.

    SQL & Datadata cleaningdeduplicationaggregation
  • Greedy & IntervalsEasyAuto-graded
    Locate Shared Free Time Slots Across Multiple Schedules

    Tests interval merging to identify time windows where all participants are simultaneously unoccupied for a minimum duration.

    Greedy & Intervalsintervalsmergingscheduling
  • Arrays & HashingMediumAuto-graded
    Adjust P-Values for Multiple Testing Corrections

    Tests implementation of Bonferroni and Holm-Bonferroni procedures to control family-wise error rate when conducting multiple hypothesis tests.

    Arrays & Hashingstatisticshypothesis-testingmultiple-testingalgorithms
  • Trees & GraphsMediumAuto-graded
    Compute Minimum Distances to Multiple Destinations

    Tests understanding of single-source shortest path algorithms on weighted directed graphs with positive edge weights.

    Trees & Graphsshortest-pathdijkstragraph-traversalpriority-queue
  • SQL & DataMediumAuto-graded
    Compute Running Department Salary Budget with Resets

    Tests the ability to implement window-style running totals that accumulate within groups and reset at group boundaries, mimicking SQL's SUM() OVER (PARTITION BY ... ORDER BY ...).

    SQL & Datawindow functionsrunning totalsdata processing
  • Trees & GraphsMediumAuto-graded
    Island Detection and Letter Selection Counting

    Tests graph traversal for connected components in a binary grid and combinatorial counting with multiset constraints.

    Trees & Graphsgraph-traversalbfsconnected-componentscombinatorics