KatInterview

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

Interview Practice Problems

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

5971
Problems
2211
Auto-graded
15
Topics
272
Added today

Showing 121–150 of 5971 results

  • SQL & DataEasyAuto-graded
    Month-over-Month Revenue Change per Store

    Group order records by store and calendar month, then compute each month's percentage change versus the store's previous active month, handling zero totals and gaps.

    SQL & Dataaggregationgroup-bywindow-functionsdictionaries
  • Data Structure DesignMediumModel answer
    Making a Memoizing Python Function Safe for Many Threads

    Critique a Python function that caches expensive results in a dict, then make it thread-safe so each input is computed once, without blocking cache hits or unrelated inputs.

    Data Structure Designpythonconcurrencycachinglocking
  • Arrays & HashingMediumAuto-graded
    Quickest Kilometer Within a Run Recorded in 5-Second Splits

    Find the highest average speed over any 1000 m stretch of a run given per-5-second distances, using prefix sums, binary search and interpolation at boundaries.

    Arrays & Hashingprefix-sumsbinary-searchsliding-windowinterpolation
  • Trees & GraphsMediumAuto-graded
    Group Staff Names by Reporting Depth

    Turn flat employee-manager records into a list of name groups by depth from the top manager, using a level-by-level breadth-first traversal.

    Trees & Graphsbfstreehash-maplevel-order
  • BehavioralMediumModel answer
    Disagreement With a Colleague and Your Real-World Use of AI Tools

    A two-part behavioral prompt: tell a story about resolving a disagreement with a coworker, then describe how you used generative AI at work and kept its output trustworthy.

    Behavioralbehavioralconflict-resolutiongenerative-aiownership
  • StringsMediumAuto-graded
    Longest Window With a Capped Number of Distinct Letters

    Find the length of the longest contiguous stretch of a string using no more than k different characters, testing the sliding-window technique with a frequency map.

    Stringssliding-windowtwo-pointershash-mapstrings
  • Math & Bit ManipulationMediumAuto-graded
    Fit a Line by Batch Gradient Descent with Standardized Input

    Implement full-batch gradient descent for a one-feature least-squares line, standardizing the input, and map the learned parameters back to the original scale.

    Math & Bit Manipulationgradient-descentlinear-regressionnumericalfeature-scaling
  • Dynamic ProgrammingMediumAuto-graded
    Climbing the Tallest Staircase Through a Height Map

    Find the longest chain of strictly rising values in a grid using only up, down, left, right steps, which tests DP over an implicit DAG with a valid processing order.

    Dynamic Programmingdynamic-programminggridtopological-ordermemoization
  • Statistics & ExperimentsHardModel answer
    Evaluate the Financial Impact of a Grocery Loyalty Scheme

    Formulate a comprehensive plan to estimate incremental profit for a retail loyalty card using staggered Difference-in-Differences, observational matching, and risk guardrails.

    Statistics & Experimentsstatisticscausal-inferencedifference-in-differencesexperiment-design
  • Arrays & HashingEasyAuto-graded
    Earliest Strict Valley in an Integer Sequence

    Scan an integer list for the leftmost interior value strictly smaller than both adjacent values, returning -1 if none exists, which tests boundary handling and strict comparisons.

    Arrays & Hashingarrayscanboundary-conditionsstrict-comparison
  • Statistics & ExperimentsMediumModel answer
    Diagnosing a 15% Monthly Rise in Batch Job Turnaround Time

    A key operational duration metric rose 15% month over month; explain how you would find the root causes with data and what actions you would recommend.

    Statistics & Experimentsroot-cause-analysismetric-diagnosismix-shiftexperimentation
  • Data Structure DesignMediumAuto-graded
    Stream Merging Iterator for Two Ordered Sequences

    Simulate a stateful iterator that lazily combines two strictly sorted sequences into a single sorted, duplicate-free stream using constant space.

    Data Structure Designdesign-dsarraysheaps-sorting
  • Data Structure DesignMediumAuto-graded
    Wildcard Word Dictionary Simulator

    Simulate a word store that answers pattern queries where '.' stands for any single letter, which is best handled with a prefix tree and a depth-aware traversal.

    Data Structure Designtriedesignwildcarddfs
  • Heaps, Sorting & SearchEasyAuto-graded
    Last Stone Standing: Repeated Smash of the Two Heaviest Weights

    Simulate repeatedly removing the two largest values and reinserting their difference, using a max-heap to find the last remaining value or 0.

    Heaps, Sorting & Searchheappriority-queuesimulation
  • Trees & GraphsMediumAuto-graded
    Web Crawling Discovery and Bracket Syntax Check

    Perform a depth-bounded graph traversal over web pages based on domain filtering, and validate balanced brackets using a stack.

    Trees & Graphsbfsgraph-traversalstackstring-validation
  • BehavioralMediumModel answer
    Stuck, Late, or Criticized: Telling Your Engineering Story

    Three behavioral prompts: a long-running blocker, a project that slipped or drew user complaints, and a clear account of your current work, reasons for moving and future technical focus.

    Behavioralbehavioralstar-methodownershipcommunication
  • System DesignHardModel answer
    Architecting a Scalable Async Text-to-Video Generation Platform

    Design a robust ML system to handle asynchronous, long-running text-to-video inference, featuring state machine orchestration, GPU worker fault tolerance, and multi-tier scheduling.

    System Designsystem-designmachine-learningdistributed-systemsasync-processing
  • Data Structure DesignMediumAuto-graded
    Sliding Window Stream Aggregator

    Design a memory-efficient real-time streaming data structure to query moving averages over a sliding temporal window.

    Data Structure Designsliding-windowdequedesignstream-processing
  • Stacks & QueuesMediumModel answer
    Line of Sight Counts for Each Person in a Row

    For each person in a row, count how many people further right they can see when anyone standing between must be shorter than both of them. Needs an O(n) approach.

    Stacks & Queuesmonotonic-stackarraysamortized-analysisnext-greater-element
  • Trees & GraphsMediumAuto-graded
    Fast Power Residue Plus Nearest-Source Grid Map

    Combine square-and-multiply modular exponentiation with a multi-source BFS that labels every grid cell with its distance to the nearest source cell.

    Trees & Graphsbfsmodular-exponentiationgridmulti-source-bfs
  • System DesignMediumModel answer
    Design a Data Ingestion System for Autonomous Vehicle Mapping Fleets

    Design an end-to-end telemetry and sensor data collection system for a mapping fleet, handling route planning, physical/wireless offloading, data quality checks, and privacy sanitization.

    System Designsystem-designdistributed-systemsetldata-pipelines
  • Data Structure DesignMediumModel answer
    Versioned Follow Graph with Time-Travel Queries and Suggestions

    Build an in-memory directed follow graph with cheap snapshots, historical edge lookups, and a friends-of-friends suggestion ranking with id tie-breaks.

    Data Structure Designgraphsnapshotsbinary-searchheap
  • Arrays & HashingMediumAuto-graded
    Chain-Reaction Tile Clearing on a Grid

    Simulate a grid game where runs of three or more equal tiles vanish together, tiles fall down, and the process repeats until the grid is stable.

    Arrays & Hashingsimulationmatrixtwo-pointersgrid
  • StringsEasyAuto-graded
    Valid Palindrome with At Most One Removal

    Determine whether a given string can be converted into a palindrome by removing no more than one character.

    Stringsstringstwo-pointers
  • Arrays & HashingMediumAuto-graded
    Find Members Missing a Nearby Provider Specialty

    Given providers and members on a 2D plane, find members with a required specialty that has no provider within a distance limit, using hashing and spatial grouping.

    Arrays & Hashinghashinggeometrygrid-bucketingsimulation
  • Statistics & ExperimentsMediumModel answer
    Probability and Regression Fundamentals: A Rapid-Fire Review

    A multi-part conceptual review covering dice probabilities, variance estimation, correlation versus independence, OLS and regularization, multicollinearity, and PCA.

    Statistics & Experimentsprobabilityolsregularizationmulticollinearity
  • Data Structure DesignMediumModel answer
    Live Scoreboard Engine for One Tennis Game

    Process a sequence of point winners for a single tennis game and print the correct score after each point, including deuce, advantage and the win-by-two rule.

    Data Structure Designsimulationstate-designclass-designedge-cases
  • Data Structure DesignMediumAuto-graded
    In-Memory Bank Ledger with Pending Transfers and Expiry

    Simulate an in-memory banking system processing sequential operations, pending transfers with fixed-window expiration, and account activity tracking.

    Data Structure DesignData StructuresSimulationDesignHash Table
  • BehavioralMediumModel answer
    Fixing a Broken Engineering Workflow: A Data-Driven Story

    Describe a time you spotted a systemic technical weakness, chose a fix over alternatives, proved it worked with evidence, and owned its ongoing cost.

    Behavioralbehavioralownershiptrade-offsmetrics
  • System DesignHardModel answer
    Architecting an Enterprise Experimentation and Feature Flag Platform

    Design a distributed, highly available A/B testing infrastructure capable of sub-millisecond variant evaluation, scale-proof event ingestion, and statistically sound automated analysis.

    System Designsystem-designab-testingdata-pipelinesdistributed-systems