KatInterview

Topic

Machine Learning interview problems

Modeling, evaluation, ML systems and LLM engineering. 510 original problems, each with a worked model answer.

Problems510

27 easy273 medium210 hard

Showing 31–60 of 510 results

  • Architect an end-to-end RAG system capable of ingesting mega-documents and handling high-token, unstructured user inputs with low latency, strict permissions, and high citation fidelity.

    Model answerragllmsearchvector-database
  • Answer five conceptual machine learning questions on regression assumptions, logistic loss, random forest feature sampling, Adam versus SGD, and narrow versus wide networks.

    Model answerlinear-regressionlogistic-regressionrandom-forestadam
  • A deep dive into Layer Normalization in Transformers: mathematical formulation, Pre-LN vs Post-LN gradient stability, RMSNorm/BatchNorm comparisons, and inference memory trade-offs.

    Model answerlayer-normalizationtransformersdeep-learninggradients
  • Architect a low-latency video feed and next-up system with focus on feature pipelines, stream joins, impression logging, and multi-objective ranking.

    Model answermachine-learningsystem-designrecommendation-systemslogging-infrastructure
  • Design an ML-backed gate for a shared compute platform that flags abusive submitted code or text and predicts memory-exhaustion crashes, with low latency, high precision, and drift monitoring.

    Model answerml-system-designcontent-moderationresource-forecastingadversarial-robustness
  • Diagnose and fix low GPU utilization and high latency in a large transformer serving fleet, covering KV cache memory, compute efficiency and multi-node communication.

    Model answerllm-servingkv-cachequantizationtensor-parallelism
  • Design an end-to-end ML system that picks personalized ads for millions of users within a tight latency budget, covering data, models, exploration, evaluation and scaling.

    Model answerctr-predictionrecommendationbanditscounterfactual-evaluation
  • Explain OLS and its assumptions, compare bagging, random forests and boosting, handle a 0.2% positive class, and outline a forecasting pipeline for data with trend and seasonality.

    Model answerolsensemblesclass-imbalancetime-series
  • Pick the one hyperparameter that, when lowered, makes a gradient-boosted tree ensemble more flexible, justify it, and describe how to confirm underfitting.

    Model answergradient-boostingunderfittinghyperparameter-tuningbias-variance
  • Design a robust system to classify genuine vs generated DNA sequences, leveraging a massive unlabelled real corpus, minimal ground-truth labels, custom negative generators, and bio-aware metrics.

    Model answermachine-learningsequence-modelingsemi-supervised-learninganomaly-detection
  • Compare strategies for searching hyperparameters, from hand tuning to Bayesian and early-stopping methods, weighing cost, parallelism and sample efficiency.

    Model answerhyperparameter-tuningbayesian-optimizationrandom-searchhyperband
  • Build a greedy decoder and a width-k beam search over a next-token model, return each sentence with its probability, and explain why long outputs score low and how to correct it.

    Model answerbeam-searchdecodinglanguage-modelslog-probabilities
  • Design an end-to-end ML recommender for a vertical clip feed with multi-stage retrieval and ranking, real-time learning, diversity and safety controls, and cold-start handling.

    Model answerrecommendation-systemsml-system-designretrieval-and-rankingcold-start
  • Design a multi-stage retrieval system that surfaces the right database tables and analytical notebooks for an internal AI coding assistant answering data queries.

    Model answerInformation RetrievalRAGSystem DesignML System Design
  • Walk through an end-to-end machine learning project lifecycle, covering framing, architecture, validation, monitoring, and causal business impact.

    Model answerml-opsmodel-deploymentfeature-storedata-leakage
  • Answer nine practical questions on statistical testing, model fit, causality, representations, optimization, imbalanced data, misleading accuracy, and experiment sanity checks.

    Model answerml-fundamentalsbias-variancegradient-descentimbalanced-data
  • Design a leakage-safe pipeline that predicts 15+ minute late arrivals from pre-departure data: audits, time-based validation, models, explanations, stress tests, and an A/B plan.

    Model answerdata-leakagetime-series-validationlightgbmcalibration
  • Describe how to recognize a model that memorizes its training data, list ways to curb it, and contrast absolute-value and squared-weight penalties on a model's coefficients.

    Model answeroverfittingregularizationbias-variancegeneralization
  • Architect a scalable, low-latency system to score payment transactions for fraud under severe class imbalance and delayed feedback loops.

    Model answersystem-designmachine-learningfraud-detectionfeature-store
  • Explain how random forests and gradient boosting reshape the bias-variance decomposition, derive the variance of correlated averages, and say when each ensemble is the better choice.

    Model answerbias-variancerandom-forestgradient-boostingensembles
  • Describe the building blocks of a language-model agent, what each is responsible for, and how they cooperate across a multi-step task with safety and evaluation in mind.

    Model answerllm-agentstool-usememoryplanning
  • Write a decoder-only transformer from memory in PyTorch: embeddings, hand-written causal multi-head attention, feed-forward layers, residual wiring, and a logits head.

    Model answertransformerpytorchself-attentioncausal-mask
  • Design a two-stage recommender for a content app where users and items are constantly new, covering models, exploration, off-policy evaluation, A/B testing and a strict latency budget.

    Model answerrecommender-systemscold-starttwo-toweroff-policy-evaluation
  • Derive the parameter update rules for mini-batch SGD (with and without momentum) and Adam, explain bias correction, and compare the two on speed, tuning, memory and generalization.

    Model answeroptimizationsgdadamdeep-learning
  • Design an end-to-end search system for a mobile app marketplace covering retrieval, ranking, personalization, cold start, abuse prevention, experimentation, and the path from heuristics to learned ranking.

    Model answersearchrankingml-system-designretrieval
  • Design an ML system that picks which candidate artwork to display for each title and viewer on a video streaming service, covering reward design, exploration, cold start, serving, and evaluation.

    Model answercontextual-banditpersonalizationoff-policy-evaluationcold-start
  • Explain when OLS is the best linear unbiased estimator, how correlated features inflate variance, and how attention, positional signals and long-context costs work in Transformers.

    Model answerlinear-regressiongauss-markovmulticollinearitytransformers
  • Build a scikit-learn and imbalanced-learn workflow for a rare-positive dataset that avoids leakage, tunes the decision threshold, and reports precision, recall and F1 on untouched data.

    Model answerimbalanced-learnsmotescikit-learnprecision-recall
  • Architect an end-to-end machine learning pipeline for real estate price prediction, covering EDA, spatial validation, feature scaling, GBDT baselines, and neural network regularization.

    Model answertabular dataregressioncross-validationregularization
  • Find and fix the hidden bugs in a PyTorch encoder-decoder trainer where validation stays at chance, AMP crashes, and runs are not reproducible, then plan the debugging.

    Model answertransformerspytorchdebuggingmixed-precision

More topics