KatInterview

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

Coding Interview Problems

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

6019
Problems
2229
Auto-graded
15
Topics
275
Added today

Showing 871–900 of 2782 results

  • Greedy & IntervalsMediumAuto-graded
    Minimum Resources Required for Scheduled Jobs

    Determine the minimum number of resources required to run a schedule of tasks given start and end times with boundary reuse allowed.

    Greedy & Intervalsgreedy-intervalsheaps-sortingarrays
  • Data Structure DesignMediumAuto-graded
    Tally Unique Words Using Your Own Open-Addressing Table

    Count unique strings in a list by building a custom hash table with probing, without using built-in sets, dictionaries, or similar lookup containers.

    Data Structure Designhash-tableopen-addressingstringshashing
  • Math & Bit ManipulationEasyAuto-graded
    Gaussian Fit Summary: Mean and Two Variance Estimates

    Compute the sample mean, the divide-by-n variance, and the divide-by-(n-1) variance from a list of numbers, tying MLE for a normal model to Bessel's correction.

    Math & Bit Manipulationstatisticsmatharraysfloating-point
  • Math & Bit ManipulationMediumAuto-graded
    Simulate IPv4 CIDR Block Iterator

    Parse IPv4 CIDR blocks and simulate step-by-step traversal over all IP addresses in the subnet range.

    Math & Bit Manipulationbit-manipulationstringsdesignmath
  • Dynamic ProgrammingMediumAuto-graded
    Full-String Matching With Single and Multi Character Wildcards

    Decide whether a pattern containing '?' and '*' wildcards matches an entire string, testing dynamic programming or greedy two-pointer matching with backtracking.

    Dynamic Programmingstringswildcard-matchingdynamic-programminggreedy
  • Stacks & QueuesHardAuto-graded
    Determine Pass Times for Single-Lane Security Gate

    Simulate the scheduling of access requests through a shared resource using state tracking and queues under conflict-resolution rules.

    Stacks & Queuesstacks-queuessimulationarrays
  • Dynamic ProgrammingHardAuto-graded
    Minimal Coin Exchange with Overpayment

    Find the minimum combined count of paid and received coins to settle a precise target value using dynamic programming.

    Dynamic Programmingdynamic-programmingarrays
  • Data Structure DesignMediumModel answer
    Design a Phone-Style Calculator in the Browser

    Build a four-function calculator UI with immediate-execution semantics, tricky key sequences handled correctly, and a layout close to a familiar mobile calculator.

    Data Structure Designstate-machinefrontendjavascriptedge-cases
  • Data Structure DesignMediumAuto-graded
    Sliding Window Score Monitor for Support Chats

    Process a stream of score updates and queries, returning the rolling average and maximum over the latest score of each chat inside a half-open time window.

    Data Structure Designsliding-windowhash-mapqueuelazy-deletion
  • Trees & GraphsEasyAuto-graded
    Navigate Web Server Maze to Target Node

    Evaluates breadth-first graph search and set tracking to traverse a network of web pages and find an exit target.

    Trees & Graphstrees-graphsbreadth-first-searchhash-map
  • StringsMediumModel answer
    Filter Words Reachable From a Target by One Character Swap

    Given a target string and a list of words, return every word that becomes the target after swapping at most one pair of characters in that word, keeping input order.

    Stringsstringstwo-pointerscharacter-frequencybuddy-strings
  • Arrays & HashingMediumAuto-graded
    Peel a Grid Layer by Layer in a Clockwise Spiral

    Flatten a rectangular grid into a list by walking its perimeter clockwise inward, using shrinking boundaries and guards so single leftover rows or columns are not read twice.

    Arrays & Hashingmatrixsimulationtwo-pointersspiral
  • Data Structure DesignEasyModel answer
    Log a Button's Label on Click with the DOM Event API

    Wire up a click handler on a page button that logs its label to the console, and explain what the event object's target property refers to, including nested-element cases.

    Data Structure Designjavascriptdomevent-handlingfrontend-fundamentals
  • Arrays & HashingMediumAuto-graded
    Cohort Return Rates by Months Since First Visit

    Group users by the month of their first activity, then compute the fraction of each cohort that was active in every later month offset, using calendar-month arithmetic.

    Arrays & Hashinghash-mapgroupingdatescohort-analysis
  • Stacks & QueuesMediumAuto-graded
    Expand Nested Repeat Notation in a Compressed String

    Parse a string with nested count-and-bracket repeat markers and expand it fully, testing recursive or stack-based parsing and careful handling of multi-digit counts.

    Stacks & Queuesstringsstackrecursionparsing
  • Data Structure DesignMediumAuto-graded
    Rolling Mean of Payload Lengths Over a 60-Second Event Window

    Process a stream of checksummed events with duplicates and out-of-order timestamps, reporting a running average payload length over a 60-second window using a queue, a set and a running sum.

    Data Structure Designdequesliding-windowhash-setstreaming
  • Math & Bit ManipulationMediumAuto-graded
    Floor of a Square Root Without Built-ins

    Compute the largest integer whose square does not exceed a non-negative integer, without using built-in roots or powers, using monotonic search or an iterative refinement.

    Math & Bit Manipulationbinary-searchmathnewton-methodinteger-arithmetic
  • StringsMediumAuto-graded
    Longest Word That Swallows Another Word in the List

    Find the longest distinct word in a list that contains a different word from the list as a contiguous substring, with a fixed tie-break and empty-string handling.

    Stringsstringssubstringsortinghash-set
  • Arrays & HashingMediumAuto-graded
    Apply a Single Capture Move on a Two-Colour Grid

    Apply one move on a grid: validate the target cell, find enclosed opponent runs in eight directions, and flip them together, or return the grid unchanged if no capture is possible.

    Arrays & Hashinggridsimulationmatrixdirections
  • Linked ListsEasyAuto-graded
    Dual Pointer Assessment: Loop Detection and Ordered Pair Sum

    Evaluate two algorithmic challenges using the two-pointer technique: detecting cyclic pointer references and locating index pairs for a target sum in an ordered list.

    Linked Listslinked-liststwo-pointersarrays
  • Math & Bit ManipulationMediumAuto-graded
    Gambler's Ruin: Chance of Hitting the Goal Before Bust

    Compute the probability that a biased ±1 random walk reaches a target balance before hitting zero, using a recurrence and closed form with careful edge cases.

    Math & Bit Manipulationprobabilitygambler's ruinrecurrencerandom walk
  • Stacks & QueuesEasyModel answer
    Run a Tiny Postfix Command Interpreter with Error Codes

    Simulate a small stack machine over whitespace-separated tokens, handling arithmetic, DUP, POP and PRINT, and stop at the first error while keeping the output produced so far.

    Stacks & Queuesstacksimulationparsingerror-handling
  • Trees & GraphsMediumAuto-graded
    Emptying a Directory Tree: Record the Deletion Order

    Produce the deterministic bottom-up deletion sequence for a file tree given as flat path lists, using an iterative post-order traversal that survives very deep nesting.

    Trees & Graphspost-orderdfsiterativestack
  • Arrays & HashingEasyAuto-graded
    Weekly Trailing Mean Over a Daily Usage Series

    Compute the mean of every full block of seven consecutive readings in a list, returning an empty list when fewer than seven readings exist; tests sliding-window technique.

    Arrays & Hashingsliding-windowarraysprefix-sumsnumerics
  • Data Structure DesignEasyModel answer
    Immutable Folder Tree State with Safe Move and Delete

    Design a normalized, immutable state model for a nested folder tree and implement add, move (with cycle rejection) and recursive delete efficiently for deep trees.

    Data Structure Designtreestate-managementimmutabilitycycle-detection
  • Data Structure DesignMediumAuto-graded
    Track Busiest Processing Node in Rotating Allocation System

    Simulate round-robin package allocation across nodes with cycle resets, capacity limits, and permanent node shutdowns.

    Data Structure Designarraysdesign-dssimulation
  • Data Structure DesignMediumModel answer
    Task Scheduling Order and Undoable Command Pipeline

    Resolve prerequisite-constrained task sequences with cycle detection, then construct an extensible Command pattern system with state rollback functionality.

    Data Structure Designtrees-graphsdesign-dsstacks-queues
  • Data Structure DesignHardModel answer
    Blocking Bounded Buffer for Many Producers and Consumers

    Design and code a fixed-capacity, multi-producer multi-consumer buffer with timed blocking put/get, fair waiter ordering, clean shutdown and backpressure, and explain how you would test it.

    Data Structure Designconcurrencysynchronizationcondition-variablesbackpressure
  • Data Structure DesignHardModel answer
    Distributed Block Matrix Multiplication via Cannon's Algorithm

    Coordinate grid-based worker nodes to perform memory-efficient distributed matrix multiplication without deadlocks.

    Data Structure Designdistributed systemsmatrix multiplicationconcurrencyalgorithms
  • Data Structure DesignMediumModel answer
    Layered Ledger Service: Cash, Transfers, Fees and Held Funds

    Design and code a bank ledger that grows in stages: cash operations, per-account statements with failures, internal and external transfers with fees, and delayed transfers that lock funds.

    Data Structure Designledgermoney-handlingobject-oriented-designtransactions