KatInterview

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

Coding Interview Problems

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

6013
Problems
2228
Auto-graded
15
Topics
273
Added today

Showing 721–750 of 2127 results

  • Arrays & HashingMediumAuto-graded
    Next Lexicographic Ordering Plus Left-to-Right Calculator

    Rearrange an array in place into its next lexicographic ordering, and evaluate a parenthesis-free arithmetic string with truncating division, both in linear time.

    Arrays & Hashingnext-permutationtwo-pointersexpression-parsingin-place
  • StringsEasyAuto-graded
    Parse Hex Color Code to ARGB Integer

    Parse a hex color string (6 or 8 characters) into a 32-bit ARGB packed integer, returning a fallback on invalid input.

    Stringsstringsparsingmath-bits
  • Data Structure DesignHardAuto-graded
    Simulate a Time-Aware Financial Ledger

    Process sequential financial operations with scheduled transfers, account merging, historical snapshot queries, and activity rankings using heaps and binary search.

    Data Structure Designdesign-dsheaps-sortingarrays
  • Heaps, Sorting & SearchMediumAuto-graded
    Final Departure From a Bouncing Convoy on a Road

    Find when the last vehicle leaves a segment and which one it is, when equal-speed vehicles reverse on contact, using pass-through equivalence and order preservation.

    Heaps, Sorting & Searchsortingsimulation-shortcutghost-particlesordering-invariant
  • Data Structure DesignMediumAuto-graded
    Frozen-View Integer Set with Independent Cursors

    Simulate a mutable integer set whose iterators capture the set's contents at creation time and stay isolated from later changes and from each other.

    Data Structure Designdesignhash-setiteratorsnapshot
  • Heaps, Sorting & SearchMediumAuto-graded
    Find Boundary Indices in Sorted Sequence

    Adapt binary search to locate the starting and ending index of a target value in a sorted sequence in logarithmic time.

    Heaps, Sorting & Searchbinary-searcharrayssearching
  • Arrays & HashingEasyAuto-graded
    Dot Product of Two Run-Length Encoded Vectors

    Compute the dot product of two run-length encoded integer vectors by walking both run lists together, without expanding them into full arrays.

    Arrays & Hashingtwo-pointersrun-length-encodingsimulation
  • Trees & GraphsMediumAuto-graded
    Follow Graph: Following Lists and Mutual-Count Suggestions

    Answer batched queries on a static directed follow graph: list direct followees and rank second-hop accounts by how many followees also follow them.

    Trees & Graphsgraphhash-mapadjacency-listsorting
  • Arrays & HashingEasyAuto-graded
    Calculate Mean and Variance for the Sum of Two Variables

    Compute the expected value and total variance of the combined sum of two random variables given their individual means, variances, and covariance.

    Arrays & Hashingstatisticsprobabilitymath
  • StringsEasyAuto-graded
    Longest Streak of a Repeated Character in a String

    Scan a string once to find the longest streak of adjacent equal characters, keeping separated streaks distinct and using only constant extra memory.

    Stringsstringstwo-pointerslinear-scanstate-tracking
  • Data Structure DesignMediumAuto-graded
    Stateful Banking System Ledger Engine

    Simulate an in-memory banking ledger that processes chronologically ordered operations involving balances, leaderboards, delayed cashbacks, and account merges.

    Data Structure Designdesign-dsheaps-sortingarrays
  • Trees & GraphsMediumAuto-graded
    Column-by-Column Readout of a Binary Tree from Level-Order Input

    Group binary tree nodes by horizontal column, ordering each column by depth and then by value, with the tree given as a level-order list with nulls.

    Trees & Graphsbinary-treebfssortingcoordinates
  • Arrays & HashingMediumAuto-graded
    Resolve Callable Names from Argument Type Lists

    Match call argument types against registered signatures, some with a trailing repeatable parameter, and return the sorted names of every signature that fits each call.

    Arrays & Hashinghashingstringsvariadic-matchingprefix-keys
  • Dynamic ProgrammingHardAuto-graded
    Count and Score Conflict-Free Cap Distributions

    Count the ways to give each person a distinct acceptable item and find the best total value, using a bitmask DP over people or bounded backtracking.

    Dynamic Programmingbitmask-dpcountingbacktrackingassignment
  • Math & Bit ManipulationEasyAuto-graded
    Expected Transit Wait Time with Stochastic Delays

    Computes the expected waiting time for a passenger arriving at a random moment at a stop with probabilistic bus delays.

    Math & Bit Manipulationmathprobabilitystatisticsexpected-value
  • Math & Bit ManipulationMediumAuto-graded
    Optimal Warehouse Placement to Minimize Total Delivery Distance

    Find the minimum cumulative Manhattan distance from a single target point to all target locations in a 2D grid.

    Math & Bit Manipulationarraysmathsortinggrid
  • Trees & GraphsMediumAuto-graded
    Cheapest Dungeon Escape Through Monster Cells

    Find the minimum number of monster cells entered on any route from start to exit in a grid with walls, using a weighted shortest-path search such as Dijkstra or 0-1 BFS.

    Trees & Graphsgriddijkstrashortest-path0-1-bfs
  • Data Structure DesignMediumAuto-graded
    Call-Signature Cache with Least-Recently-Used Eviction

    Simulate a fixed-capacity LRU cache keyed by a call's positional and keyword arguments, with order-insensitive, type-aware key matching.

    Data Structure Designlru-cachehash-mapdoubly-linked-listcanonical-keys
  • StringsEasyAuto-graded
    Max Length Product of Non-Overlapping Disjoint-Alphabet Substrings

    Find the maximum product of lengths of two non-overlapping substrings that do not share any characters.

    Stringsstringsmath-bitsarrays
  • Data Structure DesignMediumAuto-graded
    Thread-Safe Inventory Management

    Simulate concurrent inventory purchases and sales ensuring atomic state updates, preventing negative inventory, and handling invalid operations cleanly.

    Data Structure Designdesign-dsarraysconcurrency
  • Heaps, Sorting & SearchEasyAuto-graded
    Combine and Sort Two Unordered Integer Sequences

    Merge two unordered arrays of integers into a single list arranged in non-decreasing order.

    Heaps, Sorting & Searchsortingarraysfundamentals
  • Greedy & IntervalsEasyAuto-graded
    Does a New Booking Collide With Existing Slots?

    Decide whether a proposed half-open time slot shares any time with a list of unsorted booked slots, testing overlap logic and correct handling of touching endpoints.

    Greedy & Intervalsintervalsoverlaphalf-openlinear-scan
  • Heaps, Sorting & SearchMediumAuto-graded
    Kth Biggest Value Across a Pair of Ascending Lists

    Find the kth largest value in the union of two ascending integer lists, counting duplicates, ideally using binary search on a partition instead of a full merge.

    Heaps, Sorting & Searchbinary-searchsorted-arraysorder-statisticstwo-arrays
  • Trees & GraphsHardAuto-graded
    Most Distinct Values After Shifting Each Element

    Choose one shift per element from a given list to maximize distinct results; tests recognizing the problem as bipartite matching and implementing Hopcroft-Karp efficiently.

    Trees & Graphsbipartite-matchinghopcroft-karpgraphsgreedy-pitfalls
  • Stacks & QueuesMediumAuto-graded
    Longest Well-Formed Bracket Run

    Find the length of the longest contiguous well-formed stretch in a string of only round brackets, testing stack-based index tracking and handling of unmatched characters.

    Stacks & Queuesstackstringparenthesestwo-pass
  • Dynamic ProgrammingMediumAuto-graded
    Check Palindrome Transformation Within K Removals

    Determine if a given string can be converted into a palindrome by removing at most k characters.

    Dynamic Programmingdynamic-programmingstringsbit-manipulation
  • Heaps, Sorting & SearchMediumAuto-graded
    Order Trading Strategies by Chance of a Positive Day

    Rank strategies by the chance of a positive next-day return, using a predictive spread that includes both daily volatility and uncertainty in the estimated mean.

    Heaps, Sorting & Searchsortingstatisticscustom-keyprobability
  • Math & Bit ManipulationEasyAuto-graded
    Exact Binomial Probability of Coin Flips

    Calculates the exact binomial probability of obtaining a specific number of heads across a series of fair coin tosses.

    Math & Bit Manipulationmathprobabilitycombinatorics
  • Heaps, Sorting & SearchHardAuto-graded
    Priority Task Scheduler with Tag Filtering and Splicing

    Schedule tasks subject to dependency constraints, priority ordering, tag-based task filtering with dependency splicing, and cycle detection.

    Heaps, Sorting & Searchheaps-sortingtrees-graphstopological-sort
  • Math & Bit ManipulationEasyAuto-graded
    Calculate Progressive Income Tax in Cents

    Determine progressive income tax in cents given bracket thresholds and percentage rates using integer math.

    Math & Bit Manipulationmatharrayssimulation