KatInterview

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

Interview Practice Problems

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

6000
Problems
2221
Auto-graded
15
Topics
273
Added today

Showing 541–570 of 6000 results

  • Greedy & IntervalsEasyAuto-graded
    Shift Pay Totals Across Time-of-Day Wage Bands

    Sum payouts for work sessions by intersecting each session with non-overlapping hourly wage bands, using interval overlap arithmetic.

    Greedy & Intervalsintervalsoverlapsimulationarrays
  • Trees & GraphsMediumModel answer
    Right Edge of a Tree and Minimal Bracket Removal

    Two linked tasks: list the nodes visible from the right of a binary tree, and delete the fewest parentheses from a string so the rest is balanced.

    Trees & Graphsbinary-treebfsstackstrings
  • System DesignHardModel answer
    Atomic Updates Across Orders, Payments and Inventory Services

    Design a protocol that keeps writes consistent across several services and databases, comparing 2PC, 3PC and Sagas, and covering failures, retries, timeouts and delivery guarantees.

    System Designdistributed-transactionstwo-phase-commitsagaidempotency
  • Heaps, Sorting & SearchMediumAuto-graded
    Pick the k-th Smallest Value Without Fully Sorting

    Find the k-th smallest value in an unsorted integer list, counting duplicates, using a linear-time selection idea such as quickselect instead of a full sort.

    Heaps, Sorting & Searchquickselectselectionpartitioningorder-statistics
  • System DesignHardModel answer
    Enterprise Document Q&A with Retrieval and Generation at Scale

    Design an end-to-end, multi-tenant retrieval-augmented question-answering platform over large, mixed-format document collections, with strict isolation, freshness, latency and cost targets.

    System Designragvector-searchml-system-designhybrid-retrieval
  • System DesignMediumModel answer
    Real-Time Chat for Mass-Audience Livestreams

    Design a chat feed for livestreams where one broadcast may have over a million viewers, with sub-half-second delivery, durable storage and live moderation.

    System Designfan-outwebsocketkafkareal-time
  • Machine LearningMediumModel answer
    Fixing an Underfit Boosted-Tree Model: Which Knob to Loosen?

    Pick the one hyperparameter that, when lowered, makes a gradient-boosted tree ensemble more flexible, justify it, and describe how to confirm underfitting.

    Machine Learninggradient-boostingunderfittinghyperparameter-tuningbias-variance
  • SQL & DataMediumModel answer
    Trial Conversion and Day-30 Return Rates per Experiment Arm

    Write one SQL query comparing control and treatment on 7-day trial conversion and on a week-long return window starting 30 days after the trial begins.

    SQL & Datasqlab-testingcohort-analysisretention
  • Heaps, Sorting & SearchMediumAuto-graded
    Window Mean After Discarding the Top Values

    Compute the mean of every fixed-size window after removing its k largest entries, which requires an ordered structure that supports efficient insertion and deletion.

    Heaps, Sorting & Searchsliding-windowheapfenwick-treeorder-statistics
  • Trees & GraphsMediumAuto-graded
    Negative Loop Reachable From a Source Vertex

    Decide whether a weighted directed graph has a negative-total cycle reachable from a given source vertex, using Bellman-Ford while ignoring unreachable regions.

    Trees & Graphsgraphsbellman-fordnegative-cycleshortest-path
  • Arrays & HashingEasyAuto-graded
    Select Stale Replica Files for Copying

    Filter a list of source file records against destination records using readability, writability, size and timestamp rules, returning names in source order.

    Arrays & Hashinghash-mapfilteringsimulation
  • StringsMediumAuto-graded
    Earliest Second the Secret Is Beyond Repair

    Find the first second at which at least m substrings of a string contain a corrupted character, using complement counting and a reverse-time merge of clean runs.

    Stringsstringsunion-findcountingreverse-simulation
  • System DesignMediumModel answer
    Design a Scalable API Rate Limiter

    Architect a high-performance, distributed rate limiting system for an API gateway handling high-throughput, bursty traffic.

    System Designrate-limiterdistributed-systemsapi-gatewayredis
  • Trees & GraphsMediumAuto-graded
    Find a Word Spanning the Fragments at a Tree's Leaves

    Stream the leaf strings of a binary tree in left-to-right order and decide whether a pattern occurs in their concatenation, without ever building the full text.

    Trees & Graphsbinary-treekmpstring-matchingiterative-dfs
  • Arrays & HashingEasyAuto-graded
    Count Distinct Engaged Ads Per Day from an Event Log

    Tests filtering an event log by type, grouping by date, counting distinct ids with sets, and returning date-sorted results while omitting dates that have no qualifying events.

    Arrays & Hashinghash-mapsetgroupingsorting
  • System DesignMediumModel answer
    Finding Identical Files in a Huge Directory Tree

    Group byte-identical files across a directory tree too large for memory, minimizing disk reads, staying correct under hash collisions, and scaling out across workers.

    System Designdeduplicationhashingexternal-memoryfile-systems
  • BehavioralMediumModel answer
    Prove Your Engineering Work Moved a Business Metric

    Describe a project you drove for a business or operational result, covering how you set success criteria, what you measured, and how you showed your own work caused the change.

    Behavioralbehavioralimpactmetricsattribution
  • Greedy & IntervalsHardAuto-graded
    Fuse Collinear Point Chains Along Shared Lines

    Group point lists by the infinite line they lie on, then fuse those that overlap or touch along that line, and return each fused group's unique points ordered along the line.

    Greedy & Intervalsgeometryintervalshashingsorting
  • Machine LearningMediumModel answer
    Building a Classifier for Authentic vs Synthetic DNA Sequences

    Design a robust system to classify genuine vs generated DNA sequences, leveraging a massive unlabelled real corpus, minimal ground-truth labels, custom negative generators, and bio-aware metrics.

    Machine Learningmachine-learningsequence-modelingsemi-supervised-learninganomaly-detection
  • System DesignHardModel answer
    Design a Scalable Distributed Task Processing Engine

    Design an architecture for a multi-tenant distributed task execution platform handling millions of parallel jobs, emphasizing fault tolerance, scheduling, leases, and idempotency.

    System Designsystem-designdistributed-systemsfault-tolerancequeues
  • Math & Bit ManipulationHardAuto-graded
    Reachability Under Sum-Replacement Moves on a Grid

    Decide whether one positive integer point can become another by repeatedly replacing a coordinate with the coordinate sum, for values up to 10^18, by reversing moves with modulo.

    Math & Bit Manipulationmatheuclidean-algorithmmoduloreverse-thinking
  • Machine LearningEasyModel answer
    Choosing a Search Strategy for Model Hyperparameters

    Compare strategies for searching hyperparameters, from hand tuning to Bayesian and early-stopping methods, weighing cost, parallelism and sample efficiency.

    Machine Learninghyperparameter-tuningbayesian-optimizationrandom-searchhyperband
  • SQL & DataEasyAuto-graded
    Name the Anomaly in an Interleaved Two-Transaction Schedule

    Identify which classic concurrency anomaly a fixed read/read/write/write schedule on one shared value produces, and return the matching option letter.

    SQL & Datatransactionsconcurrencyisolation-levelsserializability
  • BehavioralMediumModel answer
    Behavioral Prep: Motivation, Pivots and Fast Calls for a PM Loop

    Prepare structured answers for five common product-manager behavioral prompts: company motivation, role fit, a mid-project pivot, a decision under ambiguity, and a five-year plan.

    Behavioralbehavioralproduct-managerleadership-principlesstar-method
  • Trees & GraphsMediumAuto-graded
    Recover a Letter Ordering from a Sorted Word List

    Derive precedence constraints between letters from adjacent sorted words, then topologically sort them while detecting contradictions and invalid prefix orderings.

    Trees & Graphstopological-sortgraphstringscycle-detection
  • System DesignHardModel answer
    Building a Global Multi-Tenant Scheduling and Events Platform

    Design a calendar backend for hundreds of millions of users covering events, recurrence, time zones, sharing, reminders, sync, and storage choices, with APIs, schemas, queries, and scaling.

    System Designsystem-designcalendarrecurrencesharding
  • Statistics & ExperimentsHardModel answer
    Sample Size Planning for a Conversion Experiment and Its Levers

    Size a two-arm conversion test from a baseline rate and relative lift, then explain how tighter alpha, higher power, uneven splits, clustering, interim looks and overdispersed counts change the required n.

    Statistics & Experimentspower analysissample sizetwo-proportion z-testdesign effect
  • SQL & DataEasyAuto-graded
    Sponsors Active in Both Opening Weeks

    Given a log of ad submission rows, find the sponsors with at least one submission in week 1 and at least one in week 2, returned sorted, which tests set intersection and deduplication.

    SQL & Datasetsdeduplicationintersectiondata-manipulation
  • Statistics & ExperimentsMediumModel answer
    Reading a Flight-Delay Regression: Metrics and Diagnostics

    Walk through interpreting and diagnosing a multiple linear regression for flight delays: standardized coefficients, fit metrics, collinearity, heteroskedasticity, intercepts, and misspecified residuals.

    Statistics & Experimentslinear-regressionmulticollinearityheteroskedasticitymodel-diagnostics
  • Machine LearningMediumModel answer
    Decoding Text from Next-Token Probabilities: Greedy vs Beam

    Build a greedy decoder and a width-k beam search over a next-token model, return each sentence with its probability, and explain why long outputs score low and how to correct it.

    Machine Learningbeam-searchdecodinglanguage-modelslog-probabilities