KatInterview

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

Interview Practice Problems

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

6131
Problems
2274
Auto-graded
15
Topics
274
Added today

Showing 3091–3120 of 6131 results

  • Trees & GraphsMediumAuto-graded
    Is the Target's Cell Forced by Every Valid Seating?

    Backtracking over placements of named items on a grid under pairwise relative-position clues, deciding whether the target ends up in one cell across all valid layouts.

    Trees & Graphsbacktrackingconstraint-satisfactiongridsearch
  • Data Structure DesignMediumModel answer
    Fast Machine Selection for a Memory-Aware Table Placer

    Redesign a slow in-memory placer so it finds a machine with enough free RAM, resizes tables, and moves them quickly, while justifying a placement policy.

    Data Structure Designdata-structure-designbisectbest-fitscheduling
  • Arrays & HashingEasyAuto-graded
    Locate Two Entries That Add Up to a Goal

    Find the two distinct positions in an integer list whose values sum to a goal, using a single-pass hash map lookup instead of checking every pair.

    Arrays & Hashinghash-maparrayscomplement-lookup
  • Statistics & ExperimentsHardModel answer
    Diagnosing and Testing Pickup Wait Estimates in a Ride Marketplace

    Explain what drives a ride-hailing pickup estimate, why it matters, why longer waits can correlate with higher conversion, and design a switchback test with a justified window length.

    Statistics & Experimentsexperimentationswitchbackcausal-inferencemarketplace
  • Data Structure DesignMediumAuto-graded
    Multiset Frequency Log with Lazy Snapshot Pool Top-K

    Simulate insert, remove and top-k queries on a multiset using a snapshot pool whose stale entries are discarded lazily, testing hash maps with heaps and exact rule-following.

    Data Structure Designhash-mapheaplazy-deletiondesign
  • Statistics & ExperimentsMediumModel answer
    Testing a New Home-Feed Ranker: Experiment Design and Causal Methods

    Design an experiment for a new content-ranking model aimed at raising time spent: hypotheses, metrics, sample size, health checks, a mid-test dip, and a non-randomized geographic rollout.

    Statistics & Experimentsab-testingpower-analysisguardrail-metricsdifference-in-differences
  • System DesignMediumModel answer
    Live Bidding on Creator Posts: Hot-Auction Backend Design

    Design a backend where creators run timed auctions on posts, bids are ordered correctly under extreme contention, and millions of watchers see the leading bid within a fraction of a second.

    System Designsystem-designconcurrency-controlreal-timewebsockets
  • Trees & GraphsHardAuto-graded
    Semester Planner Plus Burst-Limited Request Filter

    Combine topological ordering to find the minimum number of semesters (or detect a cycle) with a deque-based simulation of a two-rule request throttle that reports dropped timestamps.

    Trees & Graphstopological-sortgraphcycle-detectionsliding-window
  • Statistics & ExperimentsMediumModel answer
    Turning a Vague Product Goal into an Experiment Plan

    Given an open-ended business goal, outline how you would define metrics, form hypotheses, plan instrumentation, run a first test, compare heuristic and ML options, and manage risks.

    Statistics & Experimentsexperiment-designmetricsab-testinghypotheses
  • BehavioralMediumModel answer
    Walk Through a Delivery That Slipped Past a Hard Date

    Describe a real project whose original timeline broke, covering early warning signs, your own actions, how you framed scope trade-offs to stakeholders, and what you changed afterward.

    Behavioralbehavioraldeadlinesownershipstakeholder-communication
  • Machine LearningMediumModel answer
    Vetting a Large Scraped Corpus Before Fine-Tuning a 7B Model

    Plan how to screen, score, and test a big low-trust dataset before mixing it into SFT and preference tuning, with ablations and clear release gates to avoid regressions.

    Machine Learningllm-post-trainingdata-curationsftdpo
  • Machine LearningMediumModel answer
    Leakage-Free Churn Model Pipeline Tuned for Average Precision

    Build a scikit-learn pipeline for a 5%-positive churn dataset: mixed-type preprocessing, imbalance handling, stratified CV, and tuning on precision-recall area instead of accuracy.

    Machine Learningscikit-learnclass-imbalancepipelinescross-validation
  • StringsMediumAuto-graded
    Locate the First Occurrence of a Needle in a Haystack

    Find the earliest starting index of a pattern inside a text in linear time, handling empty inputs and repetitive patterns, using a prefix-function (KMP-style) scan.

    Stringsstringskmptwo-pointerspattern-matching
  • Greedy & IntervalsMediumModel answer
    Split Overlapping Support Windows by Who Is Covering

    Break a set of possibly overlapping staffed time windows into disjoint half-open segments, each labeled with the sorted set of people covering it, dropping gaps and merging equal neighbors.

    Greedy & Intervalssweep-lineintervalshash-mapsorting
  • Greedy & IntervalsMediumAuto-graded
    Peak Concurrent Shifts Across Half-Open Time Ranges

    Find the largest number of half-open time ranges that overlap at one instant, handling shared endpoints, empty ranges and large inputs with a sweep over sorted boundaries.

    Greedy & Intervalssweep-lineintervalssortinghash-map
  • StringsEasyAuto-graded
    Tally Clean Tokens in a Space-Delimited Line

    Split a line on spaces and count the tokens made only of ASCII letters and the marks , . ? !, testing exact tokenization and character-class checks.

    Stringsstringsparsingtokenizationhash-set
  • Data Structure DesignMediumModel answer
    Timeline Lookup Store and Shared-Friend Suggestions

    Build a store that returns the latest value at or before a query time, then suggest new connections to a user based on having at least two friends in common.

    Data Structure Designbinary-searchhash-mapgraphdesign
  • System DesignMediumModel answer
    Seatback Music and Flight-Tracker App for a Tiny Armrest Display

    Design a resilient, accessible, modular seat-unit app on a 4-inch armrest touchscreen, covering telemetry delivery, offline music sync, shake-tolerant input, lazy module loading and KPIs.

    System Designclient-architectureoffline-firstaccessibilityui-design
  • BehavioralMediumModel answer
    Walk Through a Major System You Built: Design, Decisions, Results

    Present one substantial past project end to end: the problem, your role, the architecture, the hard problems you debugged, the trade-offs, the measured results, and your hindsight.

    Behavioralproject-deep-divearchitecturetradeoffsownership
  • Arrays & HashingEasyAuto-graded
    Experiment Sizing and Beta Posterior Update

    Compute the per-group sample size for a two-proportion test from a given formula, and update a Beta prior with observed Bernoulli outcomes.

    Arrays & Hashingstatisticspower-analysisbayesian-updatebeta-binomial
  • Data Structure DesignMediumAuto-graded
    Closest Repeat Distance with Fast Threshold Queries

    Precompute the smallest distance between equal values in an array once, then answer many "repeat within k" and "closest repeat" queries in constant time each.

    Data Structure Designhash-mappreprocessingbatch-queriesarrays
  • Math & Bit ManipulationMediumModel answer
    Back-Calculating a Kayak Trip's Start Time from River Speeds

    Two paddlers' first-day upstream and downstream legs fix their paddling speed. Use it to find when they must leave on day two to reach a point 23 miles upstream by 16:00.

    Math & Bit Manipulationword-problemrelative-velocityrate-time-distancealgebra
  • Statistics & ExperimentsMediumModel answer
    Causal Effect of a Smart Display Purchase on Calling Time

    Design a staggered difference-in-differences analysis to measure how buying a calling device changes usage, handling self-selection, household spillover, and parallel-trends validation.

    Statistics & Experimentsdifference-in-differencescausal-inferencestaggered-adoptionselection-bias
  • System DesignMediumModel answer
    Build a Log Collection REST Service for a Fleet of Cameras

    Design and code a small HTTP service where cameras push log entries and users fetch them by camera, time range, or severity, with validation, status codes, and thread safety.

    System Designrest-apiflaskhttp-status-codesconcurrency
  • StringsMediumModel answer
    Three Compiler Defects in a Mini Template Engine: Debug and Test

    Diagnose three failures in a small Python template-to-source compiler: a lost ternary branch, a directory returned as a template, and a comment-only loop body, then fix each and add a regression test.

    Stringsdebuggingcode-generationastregression-testing
  • Math & Bit ManipulationEasyAuto-graded
    Equal-Sized Uniform Piles From a Card Collection

    Decide whether a multiset of integers can be split into uniform piles that all share one common size of at least two, testing counting and the GCD insight.

    Math & Bit Manipulationgcdhash-mapcountingnumber-theory
  • Machine LearningHardModel answer
    Building a Home Valuation Model for a Metropolitan Housing Market

    Design a production ML system that estimates residential sale prices across a large city, covering features, leakage-safe validation, modeling, fairness, deployment and error analysis.

    Machine Learningml-system-designgeospatialfeature-engineeringcross-validation
  • Heaps, Sorting & SearchMediumModel answer
    Batched Notification Sender with Cooldown-Aware Retries

    Push messages through a provider that accepts at most 5 per call, and retry each failure only after its own cooldown expires, with an attempt cap and no busy-waiting.

    Heaps, Sorting & Searchbatchingpriority-queueretry-schedulingmin-heap
  • Arrays & HashingEasyAuto-graded
    Top Five Senders and Receivers From Signed Transfer Logs

    Count senders and receivers from signed transfer records in a single pass, then pick the five most frequent on each side with a deterministic tie-break.

    Arrays & Hashinghash-mapcountingheapstreaming
  • Data Structure DesignMediumAuto-graded
    Simulate a Four-Seat Trick-Taking Card Game with Scoring

    Simulate a full 13-trick, four-player card game with deterministic dealing, follow-suit rules, and point scoring, and return the complete game record.

    Data Structure Designsimulationstate-managementsortinghash-map