KatInterview

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

Interview Practice Problems

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

6041
Problems
2237
Auto-graded
15
Topics
275
Added today

Showing 1231–1260 of 6041 results

  • Heaps, Sorting & SearchMediumAuto-graded
    Combine Several Pre-Sorted Lists Into One Sorted List

    Tests merging K nondecreasing integer lists into a single sorted list, preserving duplicates and handling empty lists, using a heap or pairwise merging.

    Heaps, Sorting & Searchheapmergek-way-mergesorting
  • BehavioralMediumModel answer
    Behavioral Round: Project Ownership, Cross-Team Incidents, Difficult Peers

    Prepare structured answers on a recent project, a hard technical problem, a cross-team incident from both sides, and working with a challenging colleague.

    Behavioralbehavioralleadershipconflict-resolutionstakeholder-management
  • Greedy & IntervalsMediumAuto-graded
    Fewest Segment Boosts to Make a Sequence Non-Decreasing

    Compute the minimum number of +1 contiguous-segment updates needed to make an array non-decreasing, using adjacent differences and a lower-bound argument.

    Greedy & Intervalsdifference-arraygreedyarraysrange-updates
  • Data Structure DesignHardModel answer
    Design an In-Memory Sentence Search Index

    Design a data structure that supports adding, removing, and efficiently querying sentences by keyword in real time.

    Data Structure DesignData Structure DesignInverted IndexStringHash Table
  • StringsEasyAuto-graded
    Rearrangement Check Using Letter Tallies, No Sorting

    Decide whether two lowercase strings are rearrangements of each other using letter frequency counting in linear time, without sorting.

    Stringsstringshash-tablefrequency-countanagram
  • System DesignMediumModel answer
    Strategy Review of a Four-Sided Short-Video Platform

    Analyze a short-video platform as a four-sided marketplace of viewers, creators, advertisers and merchants, then propose and defend a 12-month strategy with metrics and trade-offs.

    System Designproduct-strategyplatform-ecosystemmarketplacemetrics
  • Statistics & ExperimentsMediumModel answer
    Grouped Data Modeling: Random Intercepts, Slopes and Shrinkage

    Describe how a model with both population-level and group-level terms works, when to treat group labels as random versus fixed, how to read its outputs, and which problems to watch for.

    Statistics & Experimentsmixed-effectshierarchical-modelsshrinkageregression
  • BehavioralMediumModel answer
    Turning Hard Criticism Into Measurable Growth

    Walk through a time you got tough, work-relevant criticism, how you tested its validity, changed a specific habit, and showed with evidence that the change worked.

    Behavioralbehavioralfeedbackgrowth-mindsetself-awareness
  • BehavioralMediumModel answer
    Owning a Failing Model Under Deadline Pressure and Disagreement

    Behavioral prompt: you inherit a declining metric or model, disagree with the team's fix, and must make a time-boxed recommendation while managing risk, stakeholders, and accountability.

    Behavioralbehavioralleadershipinfluencerisk-management
  • Data Structure DesignMediumAuto-graded
    Replay Requests Through a Per-Key Throttle

    Simulate a per-key sliding-window throttle over a batch of timed requests, tracking only accepted requests and handling window-boundary expiry correctly.

    Data Structure Designsliding-windowdequehash-mapsimulation
  • System DesignMediumModel answer
    Token Budgeting and Context Assembly for a Document-Analysis LLM

    Design a middleware that packs prompt, history, retrieved passages and tool results into a 32k-token window with prioritization, citations, injection isolation and fallbacks.

    System Designllmragcontext-windowprompt-injection
  • BehavioralMediumModel answer
    Four Behavioral Stories on Ownership, Failure and Shifting Priorities

    Prepare structured stories on exceeding expectations, a real failure, juggling competing requests, and adapting to shifting requirements, showing ownership and sound prioritization.

    Behavioralbehavioralleadershipprioritizationstar-method
  • System DesignMediumModel answer
    Python Deep Dive: Runtime Mechanics, Generators, Concurrency, and Contexts

    Analyze Python runtime behaviors including mutable defaults, generator execution and cleanup, GIL-bound concurrency choices, and custom context manager protocols.

    System Designpythonconcurrencymemory-managementruntime-mechanics
  • Statistics & ExperimentsMediumModel answer
    Stress-Testing a Debit Card Spare-Change Savings Launch

    Audit a spare-change savings proposal: find the riskiest behavioral and statistical assumptions, design cheap validation tests, and plan guardrails for side effects.

    Statistics & Experimentsexperimentationproduct-analyticsab-testingcausal-inference
  • Trees & GraphsMediumAuto-graded
    Smallest Valid Order for Dependency Forest

    Construct the lexicographically smallest topological ordering of nodes in a forest defined by an ancestor/parent mapping.

    Trees & Graphstrees-graphsheaps-sortinggreedy-intervals
  • System DesignMediumModel answer
    Build a Multi-Tenant Task Tracker API at Scale

    Design a backend for a personal task manager serving millions, covering API contracts and versioning, tenant isolation, per-user throttling, caching, and data partitioning.

    System Designsystem-designrest-apirate-limitingcaching
  • Statistics & ExperimentsMediumModel answer
    Testing a Courier-Priority Elevator Rule in Apartment Towers

    Design an experiment to test whether dedicating one elevator to couriers at peak hours speeds up deliveries without hurting residents, covering randomization, metrics, and interference.

    Statistics & Experimentsab-testingexperiment-designcluster-randomizationswitchback
  • Stacks & QueuesMediumAuto-graded
    Expand Nested Repeat Patterns in an Encoded String

    Tests stack-based parsing of nested, multi-digit repeat patterns of the form count[text] to rebuild the fully expanded string.

    Stacks & Queuesstackstring-parsingnested-structuredecoding
  • Data Structure DesignMediumAuto-graded
    Simulate Snapshot Set Operations and Iterators

    Simulate mutation and snapshot iteration on a persistent set structure using interval-based logical timestamps.

    Data Structure Designdesign-dsarraysdata-structures
  • System DesignMediumModel answer
    Reservation Service Design: REST Endpoints, Schema, Date Inventory

    Design a REST API and database schema for booking a stay or rental, compare per-day and interval inventory models, and support extending an existing reservation.

    System Designrest-apischema-designinventory-modelingconcurrency
  • Arrays & HashingMediumAuto-graded
    Tally a Ten-Frame Pin-Knocking Game from Raw Throws

    Convert a flat list of throws into a ten-frame total, applying look-ahead bonuses for strikes and spares, including fill throws in the last frame.

    Arrays & Hashingsimulationarraylook-aheadpointer-walk
  • Statistics & ExperimentsMediumModel answer
    Pooling Two Sensors and Correlation in a Lattice Walk

    Find the minimum-variance linear unbiased way to pool readings from two sensors, then compute the correlation of coordinates, and of their absolute values, for a walk on the square lattice.

    Statistics & ExperimentsestimationBLUEinverse-variance weightingrandom walk
  • Trees & GraphsMediumAuto-graded
    Fewest Single-Letter Edits Through a Word List

    Tests modeling word edits as an implicit graph and running BFS with wildcard buckets to find the minimum number of one-letter changes, with careful edge cases.

    Trees & Graphsbfsgraphstringshashing
  • Greedy & IntervalsMediumAuto-graded
    Fewest Steps on a Faulty Calculator: Decrement or Double

    Find the minimum number of decrement-by-one and double operations needed to turn one positive integer into another, which rewards working backward from the target with a greedy rule.

    Greedy & Intervalsgreedymathreverse-thinking
  • StringsMediumAuto-graded
    Corridor Run With Matching Keys and Locked Doors

    Find the fewest moves along a 1D corridor with walls, keys and doors, and notice that the state space collapses to a simple prefix scan.

    Stringsbfsbitmaskstring-scanstate-space
  • Data Structure DesignMediumModel answer
    Real-Time Log Event Aggregation in React

    Design and build a React component that ingests a real-time event stream, aggregates stats per category, handles out-of-order timestamps, and throttles re-renders for high throughput.

    Data Structure Designreactdata-structuresstreamingperformance
  • System DesignHardModel answer
    Design a Scalable Feature Toggling and Targeting Platform

    Design a feature flag service enabling dynamic percentage rollouts, user targeted overrides, and ultra-low latency evaluation across distributed microservices.

    System Designsystem-designdistributed-systemscachingfeature-flags
  • Stacks & QueuesMediumAuto-graded
    Longest Stretch With Bounded Spread

    Find the longest contiguous stretch of an integer list whose largest and smallest values differ by at most a tolerance, using a sliding window with monotonic deques.

    Stacks & Queuessliding-windowmonotonic-dequearraystwo-pointers
  • Arrays & HashingEasyAuto-graded
    Order-Preserving Unique Values from a Mixed List

    Tests using a hash-based structure to drop repeated values from a list while keeping first-occurrence order, in linear time and without modifying the input.

    Arrays & Hashinghash-setordered-dictarraysdeduplication
  • System DesignMediumModel answer
    Defend Database Schema, Index Strategy, and Concurrency Controls

    Justify a database architecture by linking relational schema choices, targeted index designs, CAP theorem partition behaviors, and concurrency strategies to specific system access patterns.

    System Designdatabase-designconcurrencyindexingtransactions