KatInterview

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

Interview Practice Problems

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

6016
Problems
2229
Auto-graded
15
Topics
274
Added today

Showing 841–870 of 6016 results

  • System DesignMediumModel answer
    Design a Pay Calculation API with Retries and Idempotency

    Design a resilient HTTP API for event ingestion and worker earnings computation, featuring idempotency keys, deterministic windowing, batch partial success, and retries.

    System Designapi-designidempotencyfault-tolerancedistributed-systems
  • Data Structure DesignHardModel answer
    Payment Command Parser and Lifecycle State Machine Design

    Design a parser for fixed-arity payment commands and an object-oriented lifecycle state machine, and identify which business rules need clarification before implementation.

    Data Structure Designstate-machineparsingobject-oriented-designvalidation
  • Data Structure DesignHardModel answer
    Variable-Argument Functions Across Languages, with a Safe Logger

    Compare how two languages implement functions with a variable number of arguments, then design a type-checked key-value logger that avoids injection and needless allocation.

    Data Structure Designvariadic-functionstype-safetycalling-conventionslogging
  • Greedy & IntervalsEasyAuto-graded
    Till Payout: Greedy Bills and Coins, Listed A to Z

    Parse decimal money strings exactly into cents, detect underpayment or exact payment, then greedily break the change into named bills and coins and output them sorted alphabetically.

    Greedy & Intervalsgreedystringsparsingsorting
  • Trees & GraphsMediumAuto-graded
    Right-Triangle Distance Vertices in a Tree

    Compute distances in a tree from three marked vertices and count the other vertices whose three distances form a right-triangle (Pythagorean) triple.

    Trees & Graphsbfstreegraph-traversalmath
  • Statistics & ExperimentsMediumModel answer
    Poisson vs Normal: Contrasts, Moments, and Approximation

    Contrast the Poisson and Normal distributions, derive each one's mean and variance, and explain when and why a Poisson can be replaced by a Normal.

    Statistics & Experimentspoissonnormal-distributioncltmoments
  • SQL & DataMediumAuto-graded
    Top Opening Film Across Subscriber Watch Logs

    Find each user's earliest-watched title, then pick the title that opens the most users' histories, using deterministic tie-breaking rules.

    SQL & Datahash-mapaggregationtie-breakinggroup-by
  • Data Structure DesignMediumAuto-graded
    Shelf Command Simulator with Versioned Edits and Durable Bookmarks

    Simulate a shelf of books with positional ordering, version-checked edits and ID-based bookmarks that survive reordering and are cleaned up on deletion.

    Data Structure Designdesignhash-mapsimulationoptimistic-concurrency
  • Machine LearningMediumModel answer
    Leak-Free Pipeline for a Rare-Event Classifier

    Build a scikit-learn and imbalanced-learn workflow for a rare-positive dataset that avoids leakage, tunes the decision threshold, and reports precision, recall and F1 on untouched data.

    Machine Learningimbalanced-learnsmotescikit-learnprecision-recall
  • Machine LearningMediumModel answer
    Design a Production ML Pipeline and Prevent Overfitting on Tabular Data

    Architect an end-to-end machine learning pipeline for real estate price prediction, covering EDA, spatial validation, feature scaling, GBDT baselines, and neural network regularization.

    Machine Learningtabular dataregressioncross-validationregularization
  • Statistics & ExperimentsHardModel answer
    Support Agent Credit, KPI Drop Triage, and Wrong-Order Defects

    Design a fair agent cost and credit model, triage a sudden support KPI decline, and find and reduce the driver of wrong-order complaints in a delivery marketplace.

    Statistics & Experimentsanalyticsattributionroot-cause-analysiskpi-diagnosis
  • SQL & DataMediumAuto-graded
    Cheapest Top-Rated Purchase per Category

    Join two tables as lists, filter on a strict rating threshold with missing values, and compute a per-group minimum with a default of 0 and sorted output.

    SQL & Dataaggregationleft-joinnull-handlinggroup-by
  • BehavioralMediumModel answer
    Mastering Feedback, ML Engineering, Rapid Learning, and Career Growth

    A guide to framing responses on feedback receptiveness, practical AI/ML implementation, rapid learning strategies, technical obstacles, and career transition drivers.

    Behavioralbehavioralleadershipmachine-learningcareer-growth
  • StringsEasyAuto-graded
    Keypad Digit Prefix Word Lookup

    Encode words as keypad digit strings and answer many digit-prefix queries quickly using sorted ranges or a trie, returning matches in alphabetical order.

    Stringsbinary-searchprefixsortingtrie
  • Machine LearningHardModel answer
    Diagnosing a Misbehaving Encoder-Decoder Training Loop

    Find and fix the hidden bugs in a PyTorch encoder-decoder trainer where validation stays at chance, AMP crashes, and runs are not reproducible, then plan the debugging.

    Machine Learningtransformerspytorchdebuggingmixed-precision
  • Statistics & ExperimentsMediumModel answer
    Judging a Padded ETA Rollout: Conversion Down, Pickup Time Down

    A ride-hailing app now shows longer wait quotes. Conversion fell and pickup time dropped. Assess a manager's efficiency claim, propose alternative explanations, and design a sound experiment.

    Statistics & Experimentscausal-inferenceab-testingselection-biasswitchback
  • Linked ListsEasyAuto-graded
    Exchange the Front Element with the k-th From the Back

    Tests index arithmetic and edge-case handling by swapping the first element of a sequence with its k-th element counted from the end, including the case where both are the same element.

    Linked Listslinked-listtwo-pointersswapedge-cases
  • BehavioralHardModel answer
    Product Judgment Drill: Prioritization, Ephemeral Posts, VR Store

    A four-part product-sense exercise: how you choose and rank work, whether a short-video app should add ephemeral Stories, and how to design a VR app marketplace with metrics.

    Behavioralproduct-senseprioritizationmetricscase-study
  • Data Structure DesignMediumAuto-graded
    Card Settlement Batch with Fees, Rebates and Duplicate Guard

    Simulate a ledger: order card transactions by time, compute integer fee and rebate, enforce balance limits, and flag repeated transaction IDs.

    Data Structure Designsimulationsortinghash-setinteger-arithmetic
  • Data Structure DesignMediumModel answer
    Multi-Device Login Burst Detector over a Late-Tolerant Stream

    Design a streaming detector that flags users with 4 or more distinct devices logging in successfully within 10 minutes, tolerating events up to 30 seconds late, with bounded memory.

    Data Structure Designsliding-windowstreamingwatermarkordered-map
  • BehavioralMediumModel answer
    Demonstrating Project Lifecycle: Prototype, Business Impact, and Handoff

    Walk through a major initiative from initial problem identification and quick prototype to cross-functional adoption, quantifiable impact, and long-term maintenance handoff.

    Behavioralproject-impactcross-functionalleadershipprototyping
  • Heaps, Sorting & SearchMediumAuto-graded
    Deadline-Priority Ordering of Dependent Jobs

    Produce an execution order for jobs with prerequisites by always running the ready job with the earliest deadline, breaking ties by id, using topological sort with a heap.

    Heaps, Sorting & Searchtopological-sortheapgraphpriority-queue
  • Dynamic ProgrammingMediumAuto-graded
    Nearest Word Lookup Using Minimum Edit Operations

    Compute Levenshtein distance with dynamic programming and pick, for each query, the closest dictionary word with a stable first-index tie-break.

    Dynamic Programmingedit-distancedynamic-programmingstringstie-breaking
  • Dynamic ProgrammingMediumAuto-graded
    Counting Knight-Walk Phone Numbers on a Keypad

    Count length-n digit strings formed by knight jumps on a phone keypad, modulo 1e9+7, using DP over a small fixed graph.

    Dynamic Programmingdynamic-programminggraphmodular-arithmeticcounting
  • StringsMediumAuto-graded
    Fewest Front-Relocations to Rearrange a String

    Count the minimum moves to turn one string into another by moving characters to the front, using a multiset check and a right-to-left greedy subsequence match.

    Stringsstringsgreedytwo-pointerssubsequence
  • Statistics & ExperimentsMediumModel answer
    Calculate Overlapping Arrival Probabilities for Continuous Windows

    Find the exact probability that two independent continuous arrivals within a 60-minute interval occur within 15 minutes of each other.

    Statistics & Experimentsprobabilitycontinuous-distributionsgeometric-probabilitystatistics
  • Stacks & QueuesEasyAuto-graded
    Check Block Nesting in a Flat Marker Sequence

    Scan a list of tokens and decide whether every OPEN-style marker is matched by a later close marker, using a running counter and early rejection.

    Stacks & Queuescounterbalanced-bracketssingle-passstrings
  • Arrays & HashingEasyAuto-graded
    Build a Route Map Request with Markers and Striped Segments

    Convert longitude-first route points into a map request with start and end markers and path groups of ten segments that alternate colors and share boundary points.

    Arrays & Hashingarraysgroupingtransformationdictionaries
  • BehavioralMediumModel answer
    Pushing Back on a Technical Call and Then Backing the Decision

    Tell a structured story about disagreeing with a manager or stakeholder on a technical direction or priority, how you made your case, and how you supported the final decision.

    Behavioralbehavioralconflict-resolutionstakeholder-managementdisagree-and-commit
  • Statistics & ExperimentsMediumModel answer
    Pick a Consumer App: Metrics, Experiment, Launch Call

    Choose a consumer app, break down how it makes money and who it competes with, define key and guardrail metrics, then design and decide on an A/B test for one improvement.

    Statistics & Experimentsproduct-analyticsab-testingmetricspower-analysis