KatInterview

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

Interview Practice Problems

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

6043
Problems
2238
Auto-graded
15
Topics
274
Added today

Showing 1261–1290 of 6043 results

  • 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
  • Math & Bit ManipulationMediumAuto-graded
    Numerically Stable Focal Loss from Raw Scores

    Implement a class-weighted, focus-modulated binary cross-entropy directly from logits in pure Python, with stable math, input validation and sum/mean/none reductions.

    Math & Bit Manipulationnumerical-stabilitysigmoidloss-functionfloating-point
  • StringsMediumAuto-graded
    Longest Unique Sequence of Media Titles

    Find the maximum length of a contiguous subsequence of string titles containing no duplicated elements using a dynamic sliding window approach.

    Stringssliding-windowhash-tablestringsarrays
  • System DesignHardModel answer
    Billing-Grade Click Event Pipeline at 10M Events per Second

    Design a pipeline that records ad clicks at extreme scale, drops repeat clicks within 30 seconds, serves windowed counts per ad, and never loses billable data.

    System Designsystem-designstreamingkafkadeduplication
  • Arrays & HashingMediumModel answer
    Detect 8-Hour Cooling Streaks in a Flaky Forecast Feed

    Build a service that checks a city's latitude, pulls a 72-hour forecast from an unreliable API with proper retries, and returns every 8-hour span of strictly falling, gapless hourly temperatures.

    Arrays & Hashingsliding-windowretry-backoffapi-integrationerror-handling
  • Data Structure DesignEasyAuto-graded
    Design a Deduplicated Storage System

    Simulate file system operations while maintaining deduplicated content storage using reference counting.

    Data Structure Designdesign-dsarraysstrings
  • Data Structure DesignEasyModel answer
    Recency-Evicting Store and Random Gift-Swap Pairing

    Two short coding tasks: build a fixed-size store that drops the least recently touched key in constant time, and pair up participants from a CSV so nobody draws themselves.

    Data Structure Designlru-cachehash-mapdoubly-linked-listderangement
  • Trees & GraphsMediumAuto-graded
    Maximum Pebble Removals on a Coordinate Board

    Compute how many pebbles can be taken off a board when each removal needs another remaining pebble in the same row or column, using connected components.

    Trees & Graphsunion-findconnected-componentsgraph-modelingdfs
  • Arrays & HashingMediumAuto-graded
    Rank Documents by Query Relevance with Smoothed TF-IDF

    Tests hashing and counting over text: tokenize, compute smoothed IDF for query terms, score every document, and sort by descending score with an index tie-break.

    Arrays & Hashinghashingtf-idftokenizationsorting
  • Math & Bit ManipulationEasyAuto-graded
    Matrix Power and Empirical Transitions for a Markov Chain

    Raise a row-stochastic matrix to a given power and build a row-normalized transition estimate from observed index pairs, leaving rows with no data as zeros.

    Math & Bit Manipulationmatrix-exponentiationmarkov-chainprobabilitycounting
  • System DesignHardModel answer
    Cloud Network, Fleet Operations, Shared Files and SSO Blueprint

    Plan a layered cloud network for 2,000 servers with IP sizing, unified Linux and Windows operations, shared file storage, and single sign-on across services.

    System Designvpcnetworkingcidr-planningsystems-management
  • Statistics & ExperimentsMediumModel answer
    Debugging a Retention Drop in a Button-Color Experiment

    A product test shows lower retention after a button turned red. Explain how to rule out assignment, balance, metric and statistical artifacts before blaming the color.

    Statistics & Experimentsab-testingsample-ratio-mismatchcovariate-balancesimpsons-paradox
  • Math & Bit ManipulationMediumAuto-graded
    Scale Factor-Model Portfolio Risk to a Yearly Figure

    Compute a portfolio's one-period variance from a factor model (exposures, factor covariance, specific variances), then scale it by periods per year and take the square root.

    Math & Bit Manipulationmatrixlinear-algebrafinancequadratic-form
  • Arrays & HashingEasyAuto-graded
    Execute In-Memory Key-Value Storage Commands

    Simulate an in-memory key-value dictionary given a sequence of insertion, lookup, and deletion instructions.

    Arrays & Hashingarrayshash-mapdata-structuresdesign
  • Data Structure DesignEasyModel answer
    Show How to Use a Move-Only Heap Buffer in C++, and Defend It

    Read a move-only C++ class that owns a heap array, write a clean example program that uses it correctly, and explain the ownership, move, noexcept, explicit and const rules behind it.

    Data Structure Designcppraiimove-semanticsrule-of-five
  • Arrays & HashingEasyModel answer
    Clean and Reconcile Account Snapshots from a JSON Feed

    Parse a JSON list of account records with exact decimal arithmetic, drop invalid rows, keep the newest record per account, and report a rounded total plus a per-account map.

    Arrays & Hashingpythonjsondecimaldeduplication
  • StringsMediumAuto-graded
    Reconstruct IPv4 Addresses from Digit Sequence

    Parse a string of numeric digits into all possible valid four-part IPv4 address representations.

    Stringsstringsbacktrackingparsing
  • Arrays & HashingMediumAuto-graded
    Stream Token Lists into Fixed-Size Blocks with a Validity Mask

    Concatenate truncated token lists into equal-length blocks, zero-pad the last one, and build a parallel 0/1 mask marking real tokens versus padding.

    Arrays & Hashingarrayssimulationtwo-pointersbatching
  • Trees & GraphsMediumModel answer
    Unify Contact Profiles Linked by Common Email Addresses

    Combine contact records that are directly or transitively linked by a shared email, outputting each person's name with a deduplicated, sorted email list.

    Trees & Graphsunion-findgraphconnected-componentsdfs
  • System DesignHardModel answer
    Versioned Prompt and Config Control for a Production RAG Service

    Design a system that versions LLM prompts, models, retrieval and decoding settings, rolls changes out gradually, traces every request to its exact config, and rolls back instantly.

    System Designllm-opsragconfig-managementcanary-rollout
  • BehavioralHardModel answer
    Motivation, AI Risk Views and Career Move: Frontier Lab Narrative

    Build a coherent, specific story covering why you want to join a frontier AI lab, your considered position on advanced AI and safety, and why you are leaving your current job.

    Behavioralbehavioralmotivationai-safetyagi
  • System DesignHardModel answer
    Design a Container Job Scheduler and Telemetry Platform

    Design a distributed container execution system featuring resource-constrained scheduling, job lifecycle management, self-fencing node agents, and scalable metric ingestion.

    System Designsystem-designkubernetesdistributed-systemsmetrics
  • Heaps, Sorting & SearchMediumAuto-graded
    Maximize Uniform Cut Length for Target Segment Count

    Find the maximum integer segment length that can produce at least a specified count of equal-sized pieces using binary search on answer.

    Heaps, Sorting & Searchbinary-searcharraysgreedy
  • Heaps, Sorting & SearchMediumModel answer
    Fill Spare Slots and Sort One Buffer In Place

    Combine two unsorted integer lists into the first, which has spare room at its end, so it ends up fully ascending, without using placeholder values to locate the data.

    Heaps, Sorting & Searcharrayssortingin-placeheapsort
  • SQL & DataMediumModel answer
    Radiology Claims Spend Summary with Fiscal-Month Mapping in pandas

    Clean a small claims CSV in pandas: sum spend per procedure group, compute each group's share of the total, and derive an October-based fiscal month without row loops.

    SQL & Datapandasdata-cleaninggroupbydatetime
  • Arrays & HashingMediumAuto-graded
    Bucket Words by Letter Multiset Without Per-Word Sorting

    Cluster words that share identical letter counts into ordered buckets, using a hashable frequency key rather than sorting each word's letters, while preserving duplicates and order.

    Arrays & Hashinghash-mapstringsanagramsfrequency-count
  • Data Structure DesignMediumAuto-graded
    Run-of-K Grid Game Simulator for Many Players

    Simulate an N x N, M-player connect-K game with turn order, move validation, win detection from the last move, board snapshots and undo.

    Data Structure Designsimulationgriddesignundo
  • Statistics & ExperimentsMediumModel answer
    Diagnosing Profit Drop and Framing Executive Recommendations

    Break down a sudden profit decline using structured financial decomposition, pinpoint root operational causes, and deliver a data-driven recommendation summary.

    Statistics & Experimentsmetric decompositionroot cause analysisprofitabilitybusiness case
  • System DesignMediumModel answer
    Per-User Throttling for a Multiplayer Game API at Scale

    Design a distributed service that caps each user's request volume per rolling minute across many app servers, rejecting excess calls with HTTP 429 while staying fast and available.

    System Designrate-limitingdistributed-systemsredissliding-window