KatInterview

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

Interview Practice Problems

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

6083
Problems
2255
Auto-graded
15
Topics
274
Added today

Showing 1951–1980 of 6083 results

  • StringsEasyModel answer
    Find Unique Words Across Two Text Blocks

    Identify words that appear in either of two given text strings, but not in both, using symmetric set difference.

    Stringsstringsarraysset-operations
  • Trees & GraphsMediumAuto-graded
    Follow Graph: Following Lists and Mutual-Count Suggestions

    Answer batched queries on a static directed follow graph: list direct followees and rank second-hop accounts by how many followees also follow them.

    Trees & Graphsgraphhash-mapadjacency-listsorting
  • Arrays & HashingEasyAuto-graded
    Calculate Mean and Variance for the Sum of Two Variables

    Compute the expected value and total variance of the combined sum of two random variables given their individual means, variances, and covariance.

    Arrays & Hashingstatisticsprobabilitymath
  • Stacks & QueuesMediumModel answer
    Build a Multi-Room Async TCP Chat Server

    Implement a concurrent, room-based TCP chat server in Python using asyncio, featuring command processing, scoped broadcasts, backpressure handling, and strict resource cleanup.

    Stacks & Queuesconcurrencyasyncionetworkingpython
  • StringsEasyAuto-graded
    Longest Streak of a Repeated Character in a String

    Scan a string once to find the longest streak of adjacent equal characters, keeping separated streaks distinct and using only constant extra memory.

    Stringsstringstwo-pointerslinear-scanstate-tracking
  • Data Structure DesignMediumAuto-graded
    Stateful Banking System Ledger Engine

    Simulate an in-memory banking ledger that processes chronologically ordered operations involving balances, leaderboards, delayed cashbacks, and account merges.

    Data Structure Designdesign-dsheaps-sortingarrays
  • Greedy & IntervalsMediumModel answer
    Peak Overlap Point, Bounded BST Sums, and Call-Stack Self Time

    Three separate tasks: find an integer with the highest interval overlap, sum BST values within a range (plus many-query speedups), and compute per-function self time from nested start/end logs.

    Greedy & Intervalssweep-linebstprefix-sumsstack
  • Data Structure DesignHardModel answer
    Expiring Resource Credit Ledger with Out-of-Order Events

    Design an in-memory compute credit ledger handling expiring grants, usage subtractions with earliest-expiration priority, out-of-order event ingestion, and point-in-time balance queries.

    Data Structure Designdesign-dsheaps-sortinggreedy-intervalsarrays
  • Data Structure DesignMediumModel answer
    Reconcile Cached Coverage Status with Out-of-Order Checks

    Build a reconciler that keeps a cached insurance status correct when verification results arrive late, duplicated, or as failures, and that can rebuild the status from full history.

    Data Structure Designidempotencyout-of-order eventscache consistencystate reconciliation
  • Trees & GraphsMediumAuto-graded
    Column-by-Column Readout of a Binary Tree from Level-Order Input

    Group binary tree nodes by horizontal column, ordering each column by depth and then by value, with the tree given as a level-order list with nulls.

    Trees & Graphsbinary-treebfssortingcoordinates
  • Arrays & HashingMediumAuto-graded
    Resolve Callable Names from Argument Type Lists

    Match call argument types against registered signatures, some with a trailing repeatable parameter, and return the sorted names of every signature that fits each call.

    Arrays & Hashinghashingstringsvariadic-matchingprefix-keys
  • Dynamic ProgrammingHardAuto-graded
    Count and Score Conflict-Free Cap Distributions

    Count the ways to give each person a distinct acceptable item and find the best total value, using a bitmask DP over people or bounded backtracking.

    Dynamic Programmingbitmask-dpcountingbacktrackingassignment
  • Math & Bit ManipulationEasyAuto-graded
    Expected Transit Wait Time with Stochastic Delays

    Computes the expected waiting time for a passenger arriving at a random moment at a stop with probabilistic bus delays.

    Math & Bit Manipulationmathprobabilitystatisticsexpected-value
  • System DesignMediumModel answer
    Design a Distributed Calendar Aggregation Engine

    Architect a MapReduce-based system to process massive calendar datasets and identify mutual free time slots of length d across large organizations.

    System Designsystem-designmapreducedistributed-systemsintervals
  • Math & Bit ManipulationMediumAuto-graded
    Optimal Warehouse Placement to Minimize Total Delivery Distance

    Find the minimum cumulative Manhattan distance from a single target point to all target locations in a 2D grid.

    Math & Bit Manipulationarraysmathsortinggrid
  • System DesignMediumModel answer
    Design a Real-Time News Story Aggregator

    Architect a high-throughput news feed system that ingests raw articles, groups duplicate reports into single event clusters, and serves personalized timelines at scale.

    System Designsystem-designdata-ingestionclusteringembeddings
  • System DesignHardModel answer
    Design an Urban Traffic Intersection Signal System

    Architect an autonomous, safety-critical traffic signal system featuring real-time actuation, emergency preemption, hardware safety monitors, and central orchestration.

    System Designsystem-designdistributed-systemsiotreal-time
  • BehavioralMediumModel answer
    Changing Course Midstream and Transitioning Out of a Role You Owned

    A two-part behavioral prompt: describe a project where you had to change direction midway, and a time you left a project you led as the main contact. Includes a model answer.

    Behavioralbehavioralleadershipadaptabilityhandoff
  • Trees & GraphsMediumAuto-graded
    Cheapest Dungeon Escape Through Monster Cells

    Find the minimum number of monster cells entered on any route from start to exit in a grid with walls, using a weighted shortest-path search such as Dijkstra or 0-1 BFS.

    Trees & Graphsgriddijkstrashortest-path0-1-bfs
  • Data Structure DesignMediumAuto-graded
    Call-Signature Cache with Least-Recently-Used Eviction

    Simulate a fixed-capacity LRU cache keyed by a call's positional and keyword arguments, with order-insensitive, type-aware key matching.

    Data Structure Designlru-cachehash-mapdoubly-linked-listcanonical-keys
  • Statistics & ExperimentsMediumModel answer
    Linear Regression Assumptions, OLS Residuals, and Violations

    Evaluate linear regression assumptions on 10,000 rows, prove sample residual orthogonality, analyze multicollinearity, and separate bias from standard error issues.

    Statistics & Experimentslinear-regressionolsgauss-markovmulticollinearity
  • StringsEasyAuto-graded
    Max Length Product of Non-Overlapping Disjoint-Alphabet Substrings

    Find the maximum product of lengths of two non-overlapping substrings that do not share any characters.

    Stringsstringsmath-bitsarrays
  • System DesignEasyModel answer
    Diagnosing a Host Overloaded by Excessive Logging

    Walk through how you would find out whether logging is exhausting a server, restore service safely, and put guardrails in place so the problem cannot return.

    System Designloggingobservabilityincident-responsebackpressure
  • Data Structure DesignMediumAuto-graded
    Thread-Safe Inventory Management

    Simulate concurrent inventory purchases and sales ensuring atomic state updates, preventing negative inventory, and handling invalid operations cleanly.

    Data Structure Designdesign-dsarraysconcurrency
  • Heaps, Sorting & SearchEasyAuto-graded
    Combine and Sort Two Unordered Integer Sequences

    Merge two unordered arrays of integers into a single list arranged in non-decreasing order.

    Heaps, Sorting & Searchsortingarraysfundamentals
  • System DesignMediumModel answer
    Long-Term User Memory for a Personalized LLM Assistant

    Design a low-latency, scalable memory layer that lets an LLM assistant remember user facts, retrieve the relevant ones per turn, resolve conflicts, and honor deletion requests.

    System Designllmmemoryvector-searchpersonalization
  • System DesignHardModel answer
    Design a Hospitality Platform Wallet with Authorizations and Payouts

    Design a robust multi-currency ledger and wallet architecture supporting holds, captures, host payouts, idempotent processing, and automated reconciliation.

    System Designsystem-designledgerfintechidempotency
  • Greedy & IntervalsEasyAuto-graded
    Does a New Booking Collide With Existing Slots?

    Decide whether a proposed half-open time slot shares any time with a list of unsorted booked slots, testing overlap logic and correct handling of touching endpoints.

    Greedy & Intervalsintervalsoverlaphalf-openlinear-scan
  • BehavioralMediumModel answer
    Why Join a Research-Driven Product Team? Building the Answer

    Build a credible answer for why you want to join a team that explores new products and infrastructure, tying your motivation to real evidence, a working style, and responsible delivery.

    Behavioralbehavioralmotivationleadershipexperimentation
  • BehavioralMediumModel answer
    Walk Through a Business-Impacting Analytics Project

    Structure a story about an analytics project using STAR, highlighting business impact, data grain, method choice, and handling limitations.

    Behavioralbehavioralanalyticscommunicationproduct-analytics