KatInterview

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

Interview Practice Problems

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

5966
Problems
2209
Auto-graded
15
Topics
271
Added today

Showing 61–90 of 3757 results

  • Statistics & ExperimentsMediumModel answer
    Marketplace Experiments: Incentives, Losing Tests, Cancellations

    Four product-analytics scenarios for a three-sided delivery marketplace: courier incentive tests, a losing A/B result, a cancellation spike, and merchant promotion setup.

    Statistics & Experimentsab-testingmarketplacemetricsinterference
  • Machine LearningMediumModel answer
    Tokenizer Trade-Offs and Reference-Regularized Fine-Tuning

    Analyze structural trade-offs in LLM subword tokenization and explain the mathematical role of KL constraints during model alignment.

    Machine LearningLLMTokenizationNLPFine-Tuning
  • Data Structure DesignMediumModel answer
    Audited Lazy File Streaming with Generators, Decorators and with

    Build a decorator that audits a chunked file-reading generator's lifecycle, with deterministic file cleanup on completion, early exit, errors and garbage collection.

    Data Structure Designpythongeneratorsdecoratorscontext-managers
  • Heaps, Sorting & SearchMediumModel answer
    Find Index of Local Minimum Using Binary Search

    Locate a local minimum in an array of integers in logarithmic time while handling flat regions and boundaries.

    Heaps, Sorting & Searcharraysbinary-searchalgorithms
  • Machine LearningMediumModel answer
    Design a Real-Time Sequential Music Slate Recommender

    Design an end-to-end sequential music recommendation engine that adapts dynamically to real-time user actions while delivering 10-track slates within 200ms P99 latency.

    Machine Learningrecommendation-systemssequential-recommendationreal-time-mlsystem-design
  • System DesignHardModel answer
    Architecting a Scalable, Fault-Tolerant Enterprise Feature Store

    Design a production ML feature store supporting streaming and batch ingestion, low-latency online serving, point-in-time correctness, and CI/CD feature governance.

    System Designmachine-learningsystem-designdata-engineeringdistributed-systems
  • Heaps, Sorting & SearchMediumModel answer
    Implement Weighted Index Selector with Efficient Retrieval

    Design a data structure that accepts an array of positive item weights and samples indices proportional to their relative weight values.

    Heaps, Sorting & Searchbinary searchprefix sumrandom samplingdesign-ds
  • Machine LearningEasyModel answer
    Setting a Score Cutoff: Weighing Missed Positives Against False Alarms

    Explain how precision and recall shift as a classifier's score cutoff moves, and justify a production threshold given unequal error costs, limited capacity, and rare positives.

    Machine Learningprecision-recallclassification-thresholdimbalanced-datacalibration
  • BehavioralMediumModel answer
    Hiring Manager Chat: Showing Fit, Impact, and Leadership

    Prepare for a 30-minute conversation with a hiring manager covering motivation, a high-impact project, a cross-team conflict, handling ambiguity, and the kind of manager and culture you want.

    Behavioralbehavioralhiring-managerleadershipstar-method
  • Machine LearningHardModel answer
    Leak-Proof Preprocessing and Training Pipeline Design

    Design an end-to-end workflow that validates, cleans, splits, fits, and serves a model so that no statistic from held-out or future data influences training.

    Machine Learningdata-leakagepreprocessingpipelinesvalidation
  • Data Structure DesignMediumModel answer
    Making a Memoizing Python Function Safe for Many Threads

    Critique a Python function that caches expensive results in a dict, then make it thread-safe so each input is computed once, without blocking cache hits or unrelated inputs.

    Data Structure Designpythonconcurrencycachinglocking
  • BehavioralMediumModel answer
    Disagreement With a Colleague and Your Real-World Use of AI Tools

    A two-part behavioral prompt: tell a story about resolving a disagreement with a coworker, then describe how you used generative AI at work and kept its output trustworthy.

    Behavioralbehavioralconflict-resolutiongenerative-aiownership
  • Statistics & ExperimentsHardModel answer
    Evaluate the Financial Impact of a Grocery Loyalty Scheme

    Formulate a comprehensive plan to estimate incremental profit for a retail loyalty card using staggered Difference-in-Differences, observational matching, and risk guardrails.

    Statistics & Experimentsstatisticscausal-inferencedifference-in-differencesexperiment-design
  • Statistics & ExperimentsMediumModel answer
    Diagnosing a 15% Monthly Rise in Batch Job Turnaround Time

    A key operational duration metric rose 15% month over month; explain how you would find the root causes with data and what actions you would recommend.

    Statistics & Experimentsroot-cause-analysismetric-diagnosismix-shiftexperimentation
  • BehavioralMediumModel answer
    Stuck, Late, or Criticized: Telling Your Engineering Story

    Three behavioral prompts: a long-running blocker, a project that slipped or drew user complaints, and a clear account of your current work, reasons for moving and future technical focus.

    Behavioralbehavioralstar-methodownershipcommunication
  • System DesignHardModel answer
    Architecting a Scalable Async Text-to-Video Generation Platform

    Design a robust ML system to handle asynchronous, long-running text-to-video inference, featuring state machine orchestration, GPU worker fault tolerance, and multi-tier scheduling.

    System Designsystem-designmachine-learningdistributed-systemsasync-processing
  • Stacks & QueuesMediumModel answer
    Line of Sight Counts for Each Person in a Row

    For each person in a row, count how many people further right they can see when anyone standing between must be shorter than both of them. Needs an O(n) approach.

    Stacks & Queuesmonotonic-stackarraysamortized-analysisnext-greater-element
  • System DesignMediumModel answer
    Design a Data Ingestion System for Autonomous Vehicle Mapping Fleets

    Design an end-to-end telemetry and sensor data collection system for a mapping fleet, handling route planning, physical/wireless offloading, data quality checks, and privacy sanitization.

    System Designsystem-designdistributed-systemsetldata-pipelines
  • Data Structure DesignMediumModel answer
    Versioned Follow Graph with Time-Travel Queries and Suggestions

    Build an in-memory directed follow graph with cheap snapshots, historical edge lookups, and a friends-of-friends suggestion ranking with id tie-breaks.

    Data Structure Designgraphsnapshotsbinary-searchheap
  • Statistics & ExperimentsMediumModel answer
    Probability and Regression Fundamentals: A Rapid-Fire Review

    A multi-part conceptual review covering dice probabilities, variance estimation, correlation versus independence, OLS and regularization, multicollinearity, and PCA.

    Statistics & Experimentsprobabilityolsregularizationmulticollinearity
  • Data Structure DesignMediumModel answer
    Live Scoreboard Engine for One Tennis Game

    Process a sequence of point winners for a single tennis game and print the correct score after each point, including deuce, advantage and the win-by-two rule.

    Data Structure Designsimulationstate-designclass-designedge-cases
  • BehavioralMediumModel answer
    Fixing a Broken Engineering Workflow: A Data-Driven Story

    Describe a time you spotted a systemic technical weakness, chose a fix over alternatives, proved it worked with evidence, and owned its ongoing cost.

    Behavioralbehavioralownershiptrade-offsmetrics
  • System DesignHardModel answer
    Architecting an Enterprise Experimentation and Feature Flag Platform

    Design a distributed, highly available A/B testing infrastructure capable of sub-millisecond variant evaluation, scale-proof event ingestion, and statistically sound automated analysis.

    System Designsystem-designab-testingdata-pipelinesdistributed-systems
  • System DesignMediumModel answer
    Building a Cited Question-Answering Service Over Text, PDFs and Images

    Design an enterprise assistant that retrieves evidence from text, PDFs and images, then generates answers with citations while respecting access controls, latency and cost limits.

    System Designragmultimodalretrievalembeddings
  • System DesignMediumModel answer
    From Class Lifecycles to Hooks: Effects, Stale Closures, Reuse

    Port a class component's fetch-and-timer lifecycle to useEffect, diagnose a stale-closure bug in a counter, and compare HOCs and render props with custom hooks.

    System DesignreacthooksuseEffectclosures
  • Data Structure DesignMediumModel answer
    Snapshot and Restore for an In-Memory String Map

    Build an in-memory string map in C++ that can dump its full state to a byte buffer and rebuild it, handling arbitrary bytes, corrupt input, and failed restores safely.

    Data Structure Designserializationbinary-formathash-mapinput-validation
  • System DesignMediumModel answer
    Architecting a Public and Token-Shared Prompt Library

    Design a scalable prompt-sharing platform supporting public, private, and secret-link access with instant token revocation and high-throughput read caching.

    System Designsystem-designcachingauthorizationdata-modeling
  • Statistics & ExperimentsEasyModel answer
    Diagnosing Product Metric Declines and Testing Growth Interventions

    A structured product analytics framework to investigate feature engagement drops, segment data, frame root-cause hypotheses, and design controlled experiments.

    Statistics & ExperimentsA/B TestingProduct AnalyticsExperiment DesignRoot Cause Analysis
  • BehavioralMediumModel answer
    Building a Reliable Test Suite When Samples Are Scarce

    Describe a repeatable method for writing your own tests on a timed coding assessment: edge-case categories, independent expected outputs, brute-force comparison, and a clear stopping rule.

    Behavioraltestingedge-casesstress-testingonline-assessment
  • 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