KatInterview

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

ML Interview Problems

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

5980
Problems
2215
Auto-graded
15
Topics
272
Added today

Showing 211–240 of 511 results

  • Machine LearningMediumModel answer
    Transformers, Embeddings, Pretraining and Fine-Tuning Compared

    Contrast transformer architectures with embedding models, then explain why models are pretrained, how fine-tuning adapts them, and which risks to monitor.

    Machine Learningtransformersembeddingsfine-tuningtransfer-learning
  • Machine LearningMediumModel answer
    Cross-Validation Folds: Choosing k and Spotting Bad Estimates

    Describe how k-fold cross-validation works, how the choice of k shifts bias, variance and cost, and which situations make a cross-validated score overly optimistic or unreliable.

    Machine Learningcross-validationbias-variancedata-leakagemodel-evaluation
  • Machine LearningHardModel answer
    Credit Default Risk Model: Design, Cutoff, and Fairness Review

    Design an end-to-end default-risk classifier for a lender, from label definition through approval cutoff, fairness testing, explainability and post-launch monitoring.

    Machine Learningcredit-riskclassificationfairnesscalibration
  • Machine LearningMediumModel answer
    Learning a Collaboration Closeness Score for Coworker Pairs

    Design an ML system that scores how closely any two employees in an organization collaborate, covering signals, proxy labels, training, evaluation, privacy and serving.

    Machine Learningml-system-designgraph-learningembeddingslink-prediction
  • Machine LearningHardModel answer
    Designing a Live Card-Payment Fraud Scoring Pipeline

    Design an ML system that scores card payments inside the authorization path, handling extreme class imbalance, delayed labels, concept drift, and uneven costs of errors.

    Machine Learningfraud-detectionimbalanced-datafeature-storeconcept-drift
  • Machine LearningMediumModel answer
    Building a Screen-Operating AI Agent from Perception to Safety

    Design a multimodal agent that reads a desktop screen, plans multi-step tasks, drives the mouse and keyboard within a latency budget, and stays safe and measurable.

    Machine Learningagentsmultimodalvision-language-modelssystem-design
  • Machine LearningMediumModel answer
    From CTR Prediction to Sequential Feed Ranking with RL

    Design a sequential feed-ranking system for long-term retention: choose bandit vs MDP, evaluate offline with doubly robust estimators and overlap checks, and design rewards and A/B guardrails.

    Machine Learningreinforcement-learningoff-policy-evaluationdoubly-robustrecommendation-systems
  • Machine LearningMediumModel answer
    Forecasting Hourly Dock Demand for a Bike-Share Station

    Design an ML pipeline that forecasts 24 hours of bike demand per station, covering target framing, leakage-safe features, validation, and model choice.

    Machine Learningtime-seriesforecastingfeature-engineeringdata-leakage
  • Machine LearningMediumModel answer
    Near-Duplicate Image Matching Pipeline for Rights Enforcement

    Design a pipeline that checks every uploaded image against a huge catalog of protected works, tolerating edits and partial reuse, at high throughput, under a tight latency limit, with a review workflow.

    Machine Learningml-system-designcomputer-visionann-searchembeddings
  • 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
  • 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
  • Machine LearningMediumModel answer
    Why LLM Servers Store Past Keys and Values During Decoding

    Describe how attention-state caching works in decoder-only LLM serving: what is stored, why it speeds up generation, memory costs, and the production techniques that manage it.

    Machine Learningtransformersllm-inferencekv-cacheattention
  • Machine LearningHardModel answer
    Building an Enterprise Document Q&A Assistant with Retrieval

    Design a production retrieval-augmented question-answering service over company documents, covering indexing, search, grounding, freshness, access control, evaluation and operations.

    Machine Learningragretrievalembeddingsllm
  • Machine LearningHardModel answer
    Noisy Image Dataset Cleanup and a NumPy Two-Layer Net with Gradient Checks

    Plan a data-quality pipeline for a noisy, imbalanced small-image dataset, then derive and numerically verify backprop for a two-layer softmax network in NumPy.

    Machine Learninglabel-noiseclass-imbalancebackpropagationgradient-checking
  • Machine LearningEasyModel answer
    Which Ensemble Method Relies on Bootstrap Aggregation?

    Pick the model that is a canonical example of bootstrap aggregating from four options, and justify the choice by explaining how bagging reduces variance.

    Machine Learningbaggingensemble-methodsrandom-forestbias-variance
  • Machine LearningHardModel answer
    Targeting Discounts with Causal ML on Logged Data

    Design a causal ML pipeline that learns who should receive a standing promotion from observational logs, covering estimators, overlap, off-policy evaluation, fairness and a safe rollout.

    Machine Learningcausal-inferenceuplift-modelingoff-policy-evaluationdoubly-robust
  • Machine LearningHardModel answer
    Fix a Broken From-Scratch Extra-Trees Forest in NumPy

    Debug a NumPy random-split decision-tree ensemble that crashes on constant columns and returns wrong shapes, until it matches scikit-learn's accuracy.

    Machine Learningdebuggingextra-treesrandom-forestnumpy
  • Machine LearningMediumModel answer
    Choosing Between a Linear Classifier and a Forest on Small Data

    Discuss when a regularized linear probabilistic classifier beats a bagged tree ensemble on a small binary task, and how it compares with boosting.

    Machine Learninglogistic-regressionrandom-forestregularizationoverfitting
  • Machine LearningHardModel answer
    Defending Your ML Project and Explaining Diffusion Model Design

    Present one of your own ML research projects so it survives repeated probing on model choices and coding practice, then explain how diffusion models are trained, built, conditioned and sampled.

    Machine Learningdiffusion-modelsresearch-communicationgenerative-modelsddpm
  • Machine LearningHardModel answer
    Building a Click-Optimized Search Suggestion Engine

    Design a production ML system that proposes search suggestions as users type, ranking them for clicks while controlling bias, safety, latency, and long-term search quality.

    Machine Learningml-system-designsearch-suggestionsctr-predictionranking
  • Machine LearningMediumModel answer
    Designing a Layered Memory System for a Long-Lived LLM Agent

    Describe the layers of memory in a persistent LLM agent, what each holds, how it is written and read, and how the layers are managed, secured and evaluated across many sessions.

    Machine Learningllm-agentsmemoryretrievalcontext-window
  • Machine LearningMediumModel answer
    Unreliable Engagement Counter in a Filing-Completion Model

    Diagnose a cumulative usage feature with many zeros and nulls, handle its absence at scoring time, and explain why it correlates negatively with completing a tax return.

    Machine Learningfeature-engineeringmissing-datadata-leakagetraining-serving-skew
  • Machine LearningHardModel answer
    Arrival-Time Prediction for a Ride-Hailing Platform

    Design a production ML system that predicts pickup and trip-duration estimates with calibrated uncertainty, covering features, models, serving, leakage control and A/B rollout.

    Machine Learningeta-predictionuncertainty-quantificationfeature-storeconformal-prediction
  • Machine LearningMediumModel answer
    Designing a Grounded LLM Assistant for Seller Policy Questions

    Decide whether an LLM fits a seller-compliance help desk, choose an architecture, define offline and online accuracy measures, and design a safe improvement loop.

    Machine Learninggenerative-airagllm-evaluationhallucination
  • Machine LearningHardModel answer
    Building a Low-Latency Email Abuse Filter with ML

    Design a production ML pipeline that scores inbound mail within a tight latency budget, keeps hard-block false positives very low, and stays robust as attackers adapt.

    Machine Learningml-system-designspam-detectioncalibrationdrift-detection
  • Machine LearningMediumModel answer
    Tensor-Parallel Linear Layer: Forward, Backward, and Collectives

    Work out the forward and backward passes of a linear layer whose weight columns are split across devices, pinpoint the required collective, and design tests for sharding bugs.

    Machine Learningtensor-parallelismbackpropagationdistributed-trainingcollectives
  • Machine LearningMediumModel answer
    Turning Expected Profit into Keyword Bids Under a Daily Budget

    Design a system that converts predicted business value of a search-ad click into a bid, paces spend against a budget, handles delayed conversions, and proves incremental profit.

    Machine Learningbiddingadsbudget-pacingdelayed-feedback
  • Machine LearningMediumModel answer
    Hand Estimates for a Sharded GEMM: Compute, Memory and Links

    Count FLOPs, memory bytes and network bytes for a matrix product, apply the roofline model on one device, then compare M, N and K sharding and put numbers on both.

    Machine Learningrooflinearithmetic-intensityshardingcollective-communication
  • Machine LearningMediumModel answer
    Turning an ML Experiment Into Lessons for Agent Design

    Describe a recent ML experiment you owned, separate measurement from interpretation, and show how its findings would shape a concrete component of an autonomous agent.

    Machine Learningresearch-communicationai-agentsexperiment-designevaluation