KatInterview

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

Interview Practice Problems

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

6020
Problems
2229
Auto-graded
15
Topics
274
Added today

Showing 901–930 of 6020 results

  • Data Structure DesignHardAuto-graded
    Seat Row Simulator: Leftmost Block Booking and Group Release

    Simulate a row of seats where each booking takes the leftmost free block of a given length and a release frees all of a group's seats, efficiently on large inputs.

    Data Structure Designsegment-treelazy-propagationsimulationinterval-bookkeeping
  • Statistics & ExperimentsHardModel answer
    Plan a Pilot A/B Test for a Paid Messaging Add-On

    Design a randomized pilot for 1,200 businesses to measure a paid add-on's effect on revenue and 24-hour resolution, covering power, interference, compliance, monitoring and a decision rule.

    Statistics & Experimentsexperiment-designpower-analysisinterferenceinstrumental-variables
  • StringsMediumModel answer
    Define and Implement a Streaming Unicode Word Counter

    Specify precise tokenization rules for counting words in text, then build a Unicode-aware counter that works on huge streams, with tests and a regex versus scanner comparison.

    Stringstokenizationunicodestreamingstate-machine
  • Math & Bit ManipulationMediumAuto-graded
    List Every Prime Not Exceeding a Limit

    Tests whether you can enumerate all primes up to a limit efficiently using a sieve instead of per-number primality tests, including the n below 2 edge case.

    Math & Bit Manipulationsieveprimesnumber-theoryarrays
  • System DesignMediumModel answer
    Build a Link-Shortening Service That Scales to Billions

    Design a service that maps long URLs to compact aliases and redirects visitors quickly, covering APIs, storage, code generation, caching, and sharding.

    System Designsystem-designurl-shortenercachingsharding
  • BehavioralMediumModel answer
    Discuss a Highlight Technical Achievement End-to-End

    Present a high-impact technical project you led, detailing the problem, your explicit contributions, architectural trade-offs, measurable metrics, and key retrospective takeaways.

    Behavioralbehavioralleadershiptechnical-deep-diveproject-ownership
  • Data Structure DesignEasyAuto-graded
    Simulate Stream Price Volatility Monitor

    Execute stateful stream commands to maintain the two most recent values and calculate their difference and floating-point average.

    Data Structure Designdesign-dssimulationstate-management
  • Dynamic ProgrammingMediumAuto-graded
    Count Reachable Totals from a Bounded Coin Collection

    Count the distinct positive totals obtainable from a limited supply of coins per denomination, testing bounded subset-sum reachability with DP or bitset techniques.

    Dynamic Programmingdynamic-programmingsubset-sumbounded-knapsackbitset
  • Stacks & QueuesMediumAuto-graded
    Smallest Subsequence Containing Each Letter Once

    Build the lexicographically smallest subsequence that uses every distinct letter of a string exactly once, using a greedy monotonic stack with remaining-count tracking.

    Stacks & Queuesmonotonic-stackgreedystringssubsequence
  • Greedy & IntervalsMediumModel answer
    Trim Overlapping Ranges to Limit Capacity

    Truncate overlapping integer intervals so no point is covered by more than k ranges while minimizing the total removed coverage.

    Greedy & Intervalsintervalssweep-lineheapgreedy
  • System DesignMediumModel answer
    Designing and Building an In-Memory RESTful Q&A Service

    Architect and implement a minimal Q&A web service with HTTP endpoints for question creation, retrieval, and search, including pagination and data validation.

    System Designapi-designsystem-designpythonrest-api
  • Machine LearningMediumModel answer
    Support Chatbot: Combining Doc Retrieval and Order Lookups

    Design a shopping-support assistant that answers product questions from a document index and checks order data through safe, typed tools, covering routing, guardrails, sampling and evaluation.

    Machine Learningllm-agentsragtool-callingguardrails
  • Trees & GraphsMediumAuto-graded
    Semester Planner: Build a Valid Course Sequence

    Produce a deterministic topological ordering of courses from prerequisite pairs, or an empty list when a circular requirement makes it impossible.

    Trees & Graphstopological-sortgraphbfscycle-detection
  • Statistics & ExperimentsEasyModel answer
    Plan, Run and Read Out a Product Experiment From Scratch

    Describe how you would take a product change from hypothesis to launch decision using a randomized controlled experiment, covering metrics, power, validity checks, analysis and pitfalls.

    Statistics & Experimentsab-testingexperimentationpower-analysissrm
  • System DesignMediumModel answer
    High-Throughput Alert Delivery Pipeline for Spiky Traffic

    Design a multi-channel alert delivery platform that survives spikes of roughly one million writes per second, with a justified storage engine and protection against duplicate sends.

    System Designsystem-designmessage-queuecassandraidempotency
  • Machine LearningMediumModel answer
    Fix a Broken Tiny Transformer and Hand-Derive Matmul Gradients

    Debug a small decoder-only transformer whose generation is wrong, add a KV cache, then derive and implement a custom matmul autograd op and discuss parallel scans.

    Machine Learningpytorchtransformerkv-cacheautograd
  • System DesignMediumModel answer
    Designing a High-Throughput Financial Ledger Service

    Design an accurate, idempotent, and highly concurrent banking ledger database schema and transaction pipeline.

    System Designsystem-designdatabase-designconcurrencyfinancial-systems
  • SQL & DataMediumModel answer
    Feature Activation, Time-to-First-Purchase, and Region Switching in SQL

    Write SQL over users and transactions for regional activation and purchase rates, first-purchase latency with percentiles, and flagging purchases made outside a user's first-purchase region.

    SQL & Datasqlwindow-functionspercentilescohort-metrics
  • Data Structure DesignMediumModel answer
    Building a Multi-Level Credit Ledger with Timed Transfers and Merges

    Build an in-memory ledger of credit-holding workspaces in four stages: transfers with a top-k ranking, timed transfers with cancellation, workspace merges, and point-in-time balance lookups.

    Data Structure Designclass-designheapbinary-searchsimulation
  • Data Structure DesignMediumModel answer
    Prefix-Caching Transform Runner with Single-Flight and LRU

    Build a thread-safe runner for chains of deterministic byte transforms that reuses cached prefixes, collapses concurrent duplicate work into one execution, and bounds memory with LRU eviction.

    Data Structure Designconcurrencylru-cachehashingsingle-flight
  • Statistics & ExperimentsMediumModel answer
    Renew or Sell? Valuing a Streaming Show Against Its Audience

    A business case on whether to renew a 2-year deal for two shows, compute their profit, boost one show's economics, and find the break-even price for selling it.

    Statistics & Experimentsbusiness-casenpvopportunity-costincrementality
  • Math & Bit ManipulationMediumModel answer
    Build an Endless Fibonacci Stream with Python Generators

    Explain how lazy evaluation works in Python and write a generator that yields Fibonacci numbers indefinitely, with safe ways to consume it and the reasoning behind its state handling.

    Math & Bit Manipulationpythongeneratorslazy-evaluationfibonacci
  • Data Structure DesignMediumAuto-graded
    Skill-Based Task Dispatcher Simulation

    Simulate a dispatcher that gives queued tasks to skilled workers by project priority and current load, using per-project queues and tie-break rules.

    Data Structure Designdesignsimulationheaphash-map
  • SQL & DataMediumAuto-graded
    Day-30 Cohort Retention from Signup and Activity Logs

    Group users into signup-date cohorts and count who was active exactly 30 days later, using sets and date arithmetic with careful handling of duplicates.

    SQL & Datahash-setdate-arithmeticaggregationcohort-analysis
  • Machine LearningMediumModel answer
    Ranking Sponsored Posts in a Feed: Objective, Features, Evaluation

    Design a sponsored-post ranking system for a social feed: define the objective, choose features, evaluate offline, and monitor in production under a tight latency limit.

    Machine Learningads-rankingcalibrationfeature-engineeringoffline-evaluation
  • Arrays & HashingEasyAuto-graded
    Tally Opening Click-Paths Across Shoppers

    Group timestamped events by user, order them in time, and count how many distinct users share each opening action sequence of length up to k.

    Arrays & Hashinghash-mapgroupingsortingprefixes
  • StringsMediumAuto-graded
    Split Text by Longest Dictionary Prefix with Single-Char Fallback

    Scan a string left to right, always consuming the longest dictionary word starting at the current position, or one character if none match; tests tries and prefix matching.

    Stringstriegreedystring-processingprefix-matching
  • Data Structure DesignMediumAuto-graded
    Per-Key Token Bucket Admission Decisions

    Simulate independent token buckets per key over a request log, with exact fractional refill, capped capacity, and out-of-order timestamps, to decide which requests are admitted.

    Data Structure Designrate-limitertoken-buckethash-mapsimulation
  • Machine LearningMediumModel answer
    Scoring Property Photos and Predicting Listing Appeal

    Design a two-stage ML system that scores listing photos and predicts overall listing appeal to improve ranking and bookings, including targets, features, imbalance, cold start, metrics and fairness.

    Machine Learningrankingcomputer-visioncold-startposition-bias
  • Trees & GraphsMediumModel answer
    Find a Money-Making Loop in a Table of Exchange Rates

    Given directed currency exchange quotes, decide whether some round trip returns more than it started with, and output one such round trip as an ordered list of currencies.

    Trees & Graphsgraphbellman-fordnegative-cyclefloating-point