KatInterview

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

Interview Practice Problems

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

6027
Problems
2232
Auto-graded
15
Topics
272
Added today

Showing 991–1020 of 2232 results

  • Arrays & HashingMediumAuto-graded
    Maximum Score Level Backed by Enough Servers

    Find the largest k such that at least k scores are k or higher, using counting with capped values to reach linear time.

    Arrays & Hashingcountingh-indexbucketarrays
  • Arrays & HashingMediumAuto-graded
    Confirmed Connections from Invites and Replies

    Match reply events to earlier directed invites, normalize each user pair, and keep the earliest valid reply date per pair, sorted by pair.

    Arrays & Hashinghash-mapgroupingdeduplicationdates
  • Arrays & HashingMediumAuto-graded
    Most Common Item Pair Across Shopping Baskets

    Find the two products that appear together in the most orders, handling duplicate lines, mirrored pairs, ties, and orders with fewer than two distinct products.

    Arrays & Hashinghash-mapcombinationscountinggrouping
  • Data Structure DesignMediumAuto-graded
    Command-Driven Ledger with Transfer Volume Leaderboard

    Simulate an in-memory ledger from text commands, with validated transfers and a leaderboard ranked by outgoing volume with an alphabetical tie-break.

    Data Structure Designhash-mapsimulationsortingstring-parsing
  • StringsEasyAuto-graded
    Keypad Digit Sequence Word Filter

    Filter a word list down to the words whose letters, read through a phone keypad, spell out a given digit string, in original order.

    Stringsstringshash-mapfilteringsimulation
  • Data Structure DesignMediumAuto-graded
    Simulate a Topic Message Broker with Subscription Tokens

    Simulate a topic-based message broker from a command log, handling token issuance, ordered delivery records, and idempotent unsubscribes.

    Data Structure Designdesignhash-mapsimulationordering
  • Stacks & QueuesMediumAuto-graded
    Rebuild Call Start/Stop Events from Stack Snapshots

    Diff consecutive call-stack snapshots by longest common prefix to produce correctly ordered start and end events, including recursion, empty stacks and final closing.

    Stacks & Queuesstacksimulationlongest-common-prefixarrays
  • Linked ListsMediumAuto-graded
    Flip Every Block of K Consecutive Values in a Sequence

    Reverse each full consecutive block of k elements in a list of values, leaving a short trailing remainder untouched, using the pointer-based linked-list technique.

    Linked Listslinked-listin-placepointerssimulation
  • Arrays & HashingMediumAuto-graded
    Price Card Payments with Tiered Rates and Running Merchant Totals

    Parse comma-separated payment rows, build a per-row rate from several rules plus a per-merchant running total, and round fees exactly to whole cents.

    Arrays & Hashinghash-mapparsingsimulationrounding
  • Math & Bit ManipulationMediumAuto-graded
    Delta-Method Variance of a Ratio of Two Sample Means

    Apply a first-order Taylor expansion to get the approximate variance of a ratio of two correlated sample means, including the covariance term.

    Math & Bit Manipulationdelta-methodvariancecovarianceratio-metrics
  • Math & Bit ManipulationMediumAuto-graded
    Gap in Days Between Two Calendar Strings Without Date Libraries

    Parse two ISO-style date strings and compute the absolute day gap using manual Gregorian leap-year logic, without any date or calendar library.

    Math & Bit Manipulationdate-arithmeticleap-yearstring-parsingmath
  • Arrays & HashingMediumAuto-graded
    Find Accounts With Five Distinct Contacts in a Week

    Sliding-window distinct counting per group: find callers who reach at least five different receivers within any 7-day span of their call log.

    Arrays & Hashingsliding-windowhash-mapgroupingtimestamps
  • Data Structure DesignMediumAuto-graded
    Work Queue Tracker with Owners, Closing, and Late Lookups

    Simulate a task tracker driven by a list of operations, handling creation, reassignment, completion, and multi-key sorted queries while returning one result per operation.

    Data Structure Designdesignhash-mapsortingsimulation
  • Trees & GraphsMediumAuto-graded
    Column-by-Column Readout of a Level-Order Encoded Tree

    Compute the column-wise readout of a binary tree given as a level-order array, ordering nodes by column, then row, then value.

    Trees & Graphsbinary-treebfshash-mapsorting
  • Heaps, Sorting & SearchMediumAuto-graded
    Valley Finder: Binary Search on an Unsorted Zigzag Array

    Find a valley index in an array of adjacent-distinct integers in logarithmic time, using a fixed halving rule that makes the returned index deterministic.

    Heaps, Sorting & Searchbinary-searcharraysinvariantsiterative
  • Dynamic ProgrammingMediumAuto-graded
    Tallest Staircase Walk Across a Number Board

    Find the longest chain of orthogonally adjacent cells with strictly increasing values in a 2D grid, testing DAG longest-path DP, memoization, and avoiding deep recursion.

    Dynamic Programmingdynamic-programminggraphdfsmemoization
  • StringsMediumAuto-graded
    Left-to-Right Calculator Using Only Scalar State

    Evaluate a no-parentheses arithmetic string with correct precedence and truncating division in one pass, using only a few scalar variables instead of a stack.

    Stringsstring-parsingtwo-pointerssimulationconstant-space
  • Arrays & HashingMediumAuto-graded
    Audit Purchase Events Against a Payment Ledger

    Aggregate daily purchase metrics from event logs and reconcile two event snapshots against a ledger to judge whether a tracking fix worked, using hash-map grouping.

    Arrays & Hashinghashingaggregationreconciliationdictionaries
  • Data Structure DesignMediumAuto-graded
    Per-Key Cooldown Filter for a Timestamped Event Feed

    Walk a time-ordered event feed and decide which events pass a 10-second per-key cooldown, where only accepted events restart the cooldown.

    Data Structure Designhash-mapsimulationrate-limitingstreams
  • Arrays & HashingEasyAuto-graded
    Most Frequently Booked Vehicle

    Count how many booking records each vehicle has and return the ID with the highest count, breaking ties by the smallest ID.

    Arrays & Hashinghash-mapcountingtie-breaking
  • Arrays & HashingMediumAuto-graded
    Inner Product of Two Index-Value Lists

    Compute the inner product of two sparse vectors given as sorted index-value pairs by intersecting their indices with a linear merge, without building dense arrays.

    Arrays & Hashingtwo-pointerssparse-vectorsorted-mergesimulation
  • Greedy & IntervalsMediumAuto-graded
    Earliest Shared Free Slot Across Several Schedules

    Find the earliest meeting slot of a given length that fits inside everyone's availability window and avoids every busy block, by intersecting windows and merging busy intervals.

    Greedy & Intervalsintervalssweep-linesortingscheduling
  • Greedy & IntervalsMediumAuto-graded
    Merge Event Windows Within Each Locality

    Join two record lists by id, group event time ranges by locality, merge overlapping or touching ranges, and return the merged windows in a specified sort order.

    Greedy & Intervalsintervalsmerge-intervalshash-mapsorting
  • Math & Bit ManipulationHardAuto-graded
    Streaming Run/Bit-Pack Codec Session Simulator

    Simulate a codec session that buffers int32 values, emits run-length and bit-packed blocks on flush, and decodes block lists back to integers.

    Math & Bit Manipulationbit-manipulationcompressionsimulationtwos-complement
  • Data Structure DesignMediumAuto-graded
    Funding Ledger with Rail-Specific Settlement and Window Caps

    Simulate an ordered account ledger where each payment rail has its own settlement delay, cutoff-shifted window assignment, and per-window cap, and output the combined results.

    Data Structure Designsimulationhash-mapheapdesign
  • Dynamic ProgrammingHardAuto-graded
    Minimum Disorder When Interleaving Two Job Queues

    Interleave two letter strings while keeping each one's order, minimizing out-of-order pairs; tests 2D prefix DP with O(1) transition costs from alphabet-count tables.

    Dynamic Programmingdynamic-programmingstringsprefix-countsinterleaving
  • Arrays & HashingEasyAuto-graded
    Score a Top-k Search Result Against Labeled Files

    Clean a noisy ranked result list (missing, duplicated, unknown, or oversized) and compute precision and recall against ground-truth labels.

    Arrays & Hashinghashingsetsmetricsinput-validation
  • Math & Bit ManipulationEasyAuto-graded
    Detect a Rate Reversal Between Strata and Pooled Totals

    Compare two groups' success rates per stratum and pooled, using exact integer cross-multiplication, to detect when a consistent stratum winner flips in the aggregate.

    Math & Bit Manipulationsimulationfractionsaggregationsimpsons-paradox
  • StringsMediumAuto-graded
    Fewest Leading Digits Needed to Rearrange Into Each Word

    For each query digit string, find the shortest prefix of a digit string containing enough of each digit to form it, using per-digit occurrence lists and a max over digits.

    Stringsstringshashingcountingprecomputation
  • Trees & GraphsMediumAuto-graded
    Audit a Workflow Run Against Dependencies and Precedence Rules

    Check a run order against a task dependency graph, mandatory tasks and extra precedence pairs, while rejecting duplicates, unknown tasks and cyclic constraints.

    Trees & Graphsgraphtopological-sortcycle-detectionhash-map