KatInterview

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

Interview Practice Problems

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

5969
Problems
2211
Auto-graded
15
Topics
273
Added today

Showing 91–120 of 3758 results

  • Heaps, Sorting & SearchMediumModel answer
    Rolling Window Medians with Two Heaps and Lazy Removal

    Return the median of every length-k window of an integer array in O(n log k) time, handling duplicates, removals of departing elements, and the even-k convention.

    Heaps, Sorting & Searchsliding-windowheapmedianlazy-deletion
  • Data Structure DesignMediumModel answer
    Thread-Safe Ledger for Courier Payouts and Client Invoices

    Design an in-memory, thread-safe ledger that upserts delivery records and serves instant per-courier earnings and per-client invoice totals in integer cents.

    Data Structure Designconcurrencyhash-mapincremental-aggregationlow-level-design
  • System DesignMediumModel answer
    Design a Desktop OS Notification Framework with AI Collaboration

    Architect a local operating system notification system for desktop apps and use an AI assistant to refine specific low-level logic safely.

    System Designsystem designoperating systemsdesktop appsai workflows
  • Dynamic ProgrammingMediumModel answer
    Prune Minimum Nodes from Tree to Satisfy Height Budget

    Determine the minimal set of non-root node deletions required to trim a multi-child tree's height down to a target limit under node-promotion rules.

    Dynamic Programmingtrees-graphsdynamic-programmingtree-dp
  • Heaps, Sorting & SearchMediumModel answer
    Three Classics: Spaced Characters, Merged Streams, Cloned Lists

    Solve three linked tasks: rearrange a string so no neighbors match, merge k sorted linked lists, and deep-copy a linked list whose nodes carry an extra arbitrary pointer.

    Heaps, Sorting & Searchheapgreedylinked-liststring
  • Statistics & ExperimentsMediumModel answer
    Three-Ball Draw: Fast Odds for At Least Two Reds

    Find the chance of at least two reds in three draws from a red/blue/green urn, then adapt the result to replacement, a green first draw, and odds form.

    Statistics & Experimentsprobabilitycombinatoricshypergeometricconditional-probability
  • Data Structure DesignMediumModel answer
    Design a Custom CSV Parsing and Filtering Engine

    Implement an in-memory CSV query processor with auto-type inference and polymorphic field filtering.

    Data Structure Designparsingdesign-dsstringsarrays
  • Machine LearningMediumModel answer
    Production Pipeline for Predicting Subscriber Cancellation Within a Week

    Design, evaluate, monitor and roll out a weekly-horizon churn model on a shaky data foundation, covering leakage, time-aware validation, drift detection, retraining rules and fairness.

    Machine Learningml-pipelinechurn-predictiondata-leakagedrift-detection
  • System DesignMediumModel answer
    Build a Multi-Channel Alerting Pipeline for a Social App

    Design a backend that turns events from many product services into push and in-app alerts, with preferences, batching, rate limits, priority lanes, and safe retries.

    System Designsystem-designnotificationsmessage-queuerate-limiting
  • Statistics & ExperimentsHardModel answer
    Picking a Retry Cap for Flaky Audio Streaming

    Use logged interruption events to pick a maximum retry count that balances playback recovery against battery cost, and explain how to correct for bias and validate the choice before launch.

    Statistics & Experimentssurvival-analysisexperimentationcensoringcost-benefit
  • Machine LearningMediumModel answer
    Tenant-Safe Next-File Suggestions with Live Permission Checks

    Design a low-latency recommender that proposes the next file a user will open while keeping each company's data isolated and respecting constantly changing file permissions.

    Machine Learningrecommender-systemsmulti-tenancyaccess-controlcold-start
  • Trees & GraphsEasyModel answer
    Count Activations per Node in a Cascade Graph

    Given a DAG of task dependencies and one start node, compute how many times each node fires when every activation fans out once along every outgoing edge.

    Trees & Graphsdagtopological-sortpath-countinggraph-traversal
  • Heaps, Sorting & SearchMediumModel answer
    Assign Meetings to Rooms and Find the Most-Used One

    Simulate meetings being placed into n numbered rooms, delaying them when all rooms are full, then report the room that hosted the most meetings, preferring the lowest index on ties.

    Heaps, Sorting & Searchheapsimulationpriority-queueintervals
  • Heaps, Sorting & SearchMediumModel answer
    Top Words in a Huge Text File Under Tight Memory

    Count word frequencies in a text file far larger than RAM, with explicit tokenization rules and an efficient exact top-K, and analyze time, memory and disk costs.

    Heaps, Sorting & Searchword-countstreamingexternal-memorytop-k
  • Machine LearningEasyModel answer
    Trading Off Precision and Recall in Production Classifiers

    Decide when a product classifier should favor precision or recall, and explain how to set its decision threshold using error costs, capacity limits, class imbalance, and post-launch monitoring.

    Machine Learningprecision-recallthreshold-selectioncost-sensitive-learningclass-imbalance
  • System DesignMediumModel answer
    Building a Tenant-Isolated Vault for Confidential PDF Review

    Design a backend for sharing sensitive PDFs across organizations with fast permission revocation, per-viewer watermarks, and a tamper-evident record of every access.

    System Designsystem-designaccess-controlmulti-tenancyaudit-logging
  • System DesignMediumModel answer
    Secure Storefront Backend: Accounts, Carts and Safe Checkout

    Design a storefront backend where users sign up, log in, browse products, manage a personal cart and place orders safely, while APIs block access to other users' data.

    System Designauthenticationauthorizationidempotencysession-management
  • BehavioralMediumModel answer
    Deep Dive: Leading a High-Stakes Technical Initiative

    Learn how to structure and present a story about leading a complex engineering project, focusing on technical decision-making, stakeholder alignment, and self-reflection.

    BehavioralLeadershipBehavioralSystem DesignStakeholder Management
  • Machine LearningMediumModel answer
    Mitigating Overfitting and Analyzing Mean Squared Error Loss

    A deep dive into diagnosing and fixing model overfitting alongside a statistical breakdown of Mean Squared Error loss and its alternative objectives.

    Machine Learningoverfittingregularizationloss-functionsregression
  • SQL & DataMediumModel answer
    Point-in-Time User Features and 30-Day Purchase Label in SQL

    Build a leakage-free training table at a fixed snapshot: deduplicated, arrival-aware 7-day activity features per user, plus a forward-looking 30-day purchase label.

    SQL & Datasqlfeature-engineeringpoint-in-timededuplication
  • BehavioralHardModel answer
    Steering a Vague Project, Then Triaging a Sudden DAU Drop

    A two-part behavioral and analytical prompt: tell a story about bringing clarity to a vague, PM-led effort, then lay out a 48-hour response to a 20% DAU drop after a UI release.

    Behavioralbehavioralleadershipincident-responsemetrics
  • BehavioralMediumModel answer
    Career Overview and Navigating Unclear Requirements

    Give a concise, metric-driven tour of your career as an ML engineer, then tell a structured story about working through ambiguity and describe the habits you rely on.

    Behavioralbehavioralambiguityresume-walkthroughstar
  • Statistics & ExperimentsEasyModel answer
    Explaining Underfitting vs Overfitting to a Business Audience

    Describe, in plain language for non-technical colleagues, why a prediction model must balance being too simple against being too tailored to past data, and how to judge it.

    Statistics & Experimentsbias-varianceoverfittingunderfittingcommunication
  • Math & Bit ManipulationMediumModel answer
    Runners Dodging Bouncing Sentries Along a Track

    Count how many runners, released one per time unit, cross a track without ever sharing a cell at the same integer time with a sentry that bounces back and forth inside a fixed range.

    Math & Bit Manipulationsimulationmodular-arithmeticperiodic-motionparity
  • BehavioralMediumModel answer
    Resolving a Deep Disagreement With a Close Collaborator

    Tell a story about a substantive technical or strategic clash with a trusted colleague, covering how you understood their view, how the decision was made, and how the relationship held up.

    Behavioralbehavioralconflict-resolutiondisagree-and-commitcollaboration
  • BehavioralMediumModel answer
    Backend Leadership Interview: Reliable Systems, Reversals, and Pushback

    A four-part behavioral practice round for senior backend engineers covering a flagship project with idempotency and SLA depth, a reversed decision, a challenged design, and motivation.

    Behavioralbehavioralidempotencyslasenior-backend
  • System DesignMediumModel answer
    Designing a Safe Card-Charging Flow with Retries and Storage

    Design a backend flow for charging customers through an external payment provider so no one is billed twice and no payment is lost, then pick what to persist and which database to use.

    System Designidempotencypaymentsretriesdatabase-design
  • Math & Bit ManipulationEasyModel answer
    Invert Bit at Specific Index

    Invert the bit at a given index in a non-negative integer using bitwise operations.

    Math & Bit Manipulationmath-bitsbit-manipulationmath
  • System DesignMediumModel answer
    Choosing Threads, asyncio, or Processes for Python Workloads

    Explain how to tell whether a job is limited by computation or by waiting, and how the GIL affects choosing threads, asyncio, or multiprocessing for crawling, parsing, and heavy number work.

    System Designpythonconcurrencygilasyncio
  • Machine LearningHardModel answer
    Debugging Custom Transformer Encoders and Classification Pipelines

    Diagnose subtle implementation errors in PyTorch multi-head attention blocks and build an end-to-end data analysis and model evaluation workflow.

    Machine Learningtransformersdeep-learningnlppytorch