KatInterview

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

Interview Practice Problems

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

6020
Problems
2229
Auto-graded
15
Topics
274
Added today

Showing 871–900 of 2229 results

  • Dynamic ProgrammingMediumAuto-graded
    Distinct Sub-Multisets That Hit a Target Sum

    Enumerate every distinct selection of list elements, each used at most once, that sums to a target, with negatives, zeros and duplicates allowed. Tests backtracking over value counts.

    Dynamic Programmingbacktrackingsubset-sumduplicatesenumeration
  • Math & Bit ManipulationMediumAuto-graded
    Expected Number of Running Record Highs

    Compute the expected number of strict running maximum records for a uniformly random ordering of a collection of numbers.

    Math & Bit Manipulationmathprobabilityarrays
  • Data Structure DesignMediumAuto-graded
    Aggregate Executed Call Sequences across Threads

    Simulate an execution stream aggregator tracking stack call frequency across threads with custom tie-breaking rules.

    Data Structure Designdesign-dsarrayshash-table
  • Arrays & HashingMediumAuto-graded
    Can Your Unfinished Poker Hand Overtake a Showdown Hand?

    Decide whether a 3 or 4 card poker hand can be filled from the unseen deck into a five-card hand that strictly outranks a revealed five-card hand.

    Arrays & Hashingsimulationbrute-forcecombinationspoker
  • Heaps, Sorting & SearchMediumAuto-graded
    Bidirectional Bubble Sort with Early Exit and Shrinking Window

    Implement a two-direction adjacent-swap sort that returns a new sorted list, using window shrinking and early termination, while reasoning about its cost.

    Heaps, Sorting & Searchsortingtwo-pointersbubble-sortin-place
  • Data Structure DesignMediumAuto-graded
    Replay Path Insertions and Filename Lookups on a Component Trie

    Simulate an in-memory path trie driven by a list of add and search operations, with iterative traversal, path normalization, and exact rules for what counts as a file.

    Data Structure Designtrietree-traversaliterative-dfssimulation
  • Math & Bit ManipulationEasyAuto-graded
    Posterior for the Favorite After Your Entry Loses

    Apply Bayes' rule to find the chance a randomly chosen contestant was the strongest one, given that it did not win a three-way contest.

    Math & Bit Manipulationprobabilitybayes-ruleconditional-probabilitymath
  • Data Structure DesignMediumAuto-graded
    Replay a Bounded Recency Store from an Operation Log

    Simulate a fixed-size key-value store that discards the least recently touched entry when full, by replaying a log of operations and returning each result.

    Data Structure Designhash-maplinked-listsimulationcache
  • SQL & DataEasyAuto-graded
    Calculate Call Answer Metrics for Active Users

    Process call records and lifecycle logs to compute the success rate of answered calls for eligible users within a specific time frame.

    SQL & Datasqlarrayshash-table
  • Data Structure DesignMediumAuto-graded
    Quota-Limited Storage Simulator with Staging and Snapshots

    Simulate a per-user file store with staged uploads, quota checks, ranked prefix queries, and atomic snapshot restores under two conflict policies.

    Data Structure Designdesignhash-mapsimulationsorting
  • Trees & GraphsMediumAuto-graded
    Grid Land Mass Valuation

    Find all orthogonal connected components of non-zero cells in a 2D grid and calculate the total sum of cell values for each component.

    Trees & Graphstrees-graphsbreadth-first-searchdepth-first-searchmatrix
  • SQL & DataMediumAuto-graded
    Segment Survey Ratings by User Tenure and Region

    Filter invalid responses, categorize users by signup tenure, and aggregate satisfaction metrics by region and cohort.

    SQL & Datadata manipulationaggregationgroupingfiltering
  • Arrays & HashingEasyAuto-graded
    Simulate Slice Appending in Go

    Simulate how slicing and slice appending mutate backing arrays and slice headers in Go.

    Arrays & Hashingarrayssimulation
  • Data Structure DesignMediumAuto-graded
    Sliding-Window Leaderboard Replay Simulator

    Simulate a class that logs timestamped events and reports the K most frequent IDs in a closed time window, with out-of-order events and queries.

    Data Structure Designdesignbinary-searchhash-mapsorting
  • Trees & GraphsMediumAuto-graded
    Sum of Keys Within a Value Window in a Serialized BST

    Rebuild a BST from a level-order list and sum the node values inside an inclusive range, using ordering to skip subtrees that cannot contain qualifying values.

    Trees & Graphsbinary-search-treedfstree-constructionpruning
  • Data Structure DesignMediumAuto-graded
    Versioned Network Edge Tracker

    Process a stream of edge insertions, snapshot triggers, and historical adjacency queries for a dynamic graph.

    Data Structure Designdesign-dsarraystrees-graphs
  • Heaps, Sorting & SearchMediumAuto-graded
    Lowest-Numbered Free Room Booking for Time Slots

    Simulate a deterministic room-allocation process with heaps: sort by start, free finished rooms, pick the smallest free ID, and report assignments in input order.

    Heaps, Sorting & Searchheapsimulationsortingintervals
  • Data Structure DesignHardAuto-graded
    Design a Custom Key-Value Map

    Execute a series of map operations (put, get, remove) by simulating a hash map without using built-in dictionaries or sets.

    Data Structure Designarraysdesign-dshash-table
  • SQL & DataMediumAuto-graded
    Find Top-Funded Municipalities and Their Leading Projects

    Aggregate relational records over a specific date window to identify peak entities with tie preservation at multiple hierarchical levels.

    SQL & Dataarrayshash-tablesortingdate-parsing
  • Data Structure DesignEasyAuto-graded
    Rolling Ten-Minute Error Counter by Endpoint Prefix

    Replay a log of error-recording and alert-check operations, grouping errors by URL prefix and counting those in an inclusive 600-second window against a strict threshold.

    Data Structure Designdesignbinary-searchhash-mapsliding-window
  • Heaps, Sorting & SearchMediumAuto-graded
    Where Is Everyone? Locating Travelers at a Given Instant

    Group unsorted flight records by traveler and decide each traveler's status at a query timestamp, using half-open flight intervals.

    Heaps, Sorting & Searchsortinghash-mapintervalstimestamps
  • Arrays & HashingEasyAuto-graded
    Target Token Loss and Exponential Uncertainty Score

    Compute the mean negative log-likelihood across target tokens and convert it into perplexity for a given logarithm base.

    Arrays & Hashingmachine-learningmathnlp
  • Data Structure DesignMediumAuto-graded
    Typo-Tolerant Word Lookup with One Edit

    Answer batches of lookups against a fixed word list, returning every word within Levenshtein distance 1 of the query, using a deletion-based hash index.

    Data Structure Designhash-mapedit-distancestringsindexing
  • Trees & GraphsHardAuto-graded
    Climbing Routes From the Corner: Batch Lookup of Shortest Paths

    Run one BFS from the top-left cell of a grid with distinct values, using strictly increasing moves, then answer many target queries by rebuilding paths from stored parent links.

    Trees & Graphsbfsgridshortest-pathpath-reconstruction
  • Linked ListsHardAuto-graded
    Convert Multi-Level Branching List to Doubly Linked List

    Flatten a tree-like linked structure with main and side links into a single doubly linked sequence using preorder traversal.

    Linked Listslinked-liststrees-graphsstacks-queues
  • Stacks & QueuesEasyAuto-graded
    Calculate Rolling Means from a Data Stream

    Evaluate tracking a sliding window over incoming numbers to incrementally update and output moving averages.

    Stacks & Queuessliding-windowqueuedequearray
  • StringsEasyAuto-graded
    Render Payment Records as Boxed Receipt Cards

    Turn a list of parsed payment records into fixed-layout text cards, testing whitespace trimming, exact decimal rounding, and precise string formatting while preserving order.

    Stringsstring-formattingdecimalparsingsimulation
  • Data Structure DesignEasyAuto-graded
    Simulate a Constant-Time LRU Eviction Cache

    Process a series of lookup and insert requests on a fixed-size Least Recently Used (LRU) key-value cache in O(1) time per operation.

    Data Structure Designdesign-dslinked-listsarrays
  • Greedy & IntervalsEasyAuto-graded
    Maximum Affordable Items Within Budget

    Determine the maximum collection of items that can be purchased given individual item costs and a total spending limit.

    Greedy & Intervalsgreedysortingarrays
  • Data Structure DesignEasyAuto-graded
    Most Frequent Follower Lookup with Command Replay

    Simulate a train/predict command stream for a word-follower model, precomputing the top follower per word so each prediction is a single hash lookup, with a precise tie-break rule.

    Data Structure Designhash-mapdesignstringssimulation