KatInterview

Topic

Machine Learning interview problems

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

Problems511

27 easy274 medium210 hard

Showing 271–300 of 511 results

  • Design a personalized recommender from scratch, then add a chatbot that surfaces and explains those recommendations without hallucinating unavailable items.

    Model answerrecommendation systemsretrievalLLMsystem design
  • Debug a time-series forecasting system experiencing accuracy decline by isolating failures, measuring impact, and implementing fixes.

    Model answerml-systemstime-seriesdebuggingevaluation
  • Design a two-tower embedding retrieval plus ranking system for vacation rentals, covering representations, labels, bias correction, and evaluation.

    Model answerrecsystwo-towersemantic-searchposition-bias
  • Design a full ML pipeline that scores and ranks N candidate responses per user query, covering labeling, modeling, serving, evaluation, and monitoring.

    Model answerrankingreward-modelingRLHFml-system-design
  • Given a supervised model that scores much higher on training data than on held-out data, explain the bias-variance trade-off and work through a systematic plan to close the gap.

    Model answeroverfittingbias-varianceregularizationcross-validation
  • Design an end-to-end recommendation system for a large e-commerce platform, covering data pipelines, candidate retrieval, ranking, cold start, and evaluation.

    Model answerrecommendation systemsML system designtwo-tower modelcandidate retrieval
  • Write a PyTorch multi-head self-attention module that projects, splits into heads, attends, merges, and projects back to the input shape.

    Model answerpytorchattentiontransformerstensor-shapes
  • Walk through a full supervised ML lifecycle covering bag-of-words pipelines, OOB validation, CTR modeling from data to deployment, and debugging a model that degrades in production.

    Model answerclassificationfeature-engineeringctr-predictionrandom-forests
  • Derive the NLL gradient with respect to a single temperature scalar, then implement a numerically stable optimizer and calibrated inference function in Python.

    Model answercalibrationsoftmaxgradient-descentdeep-learning
  • Explain how and why L1 regularization drives coefficients to exactly zero, covering mathematical foundations, practical implications, and trade-offs.

    Model answerregularizationfeature-selectionlassooptimization
  • Walk through how you designed a personalized content system: what signals defined user interest, how you represented content and users, and how you validated that model updates actually improved outcomes.

    Model answerembeddingslabelingmodel-evaluationproduction-ml
  • Implement bootstrap sampling, multi-tree training, and majority-vote aggregation for a bagging classifier using only Python lists and the standard library.

    Model answerensemble learningdecision treesbootstrap sampling
  • Design a production search system that combines keyword and semantic retrieval, enforces tenant-level access control, and ranks results with learned models.

    Model answerml-systemsinformation-retrievalrankingembeddings
  • Describe why aggregating predictions from several models often outperforms a single model, and compare common ensemble strategies.

    Model answerensemble-learningbaggingboostingmodel-aggregation
  • Design an end-to-end ML system that ranks restaurants on a food delivery app's home screen to maximize orders and long-term user satisfaction.

    Model answerrecommendation systemsrankingtwo-towermulti-task learning
  • Design an end-to-end ML system that serves personalized financial product offers to millions of users, handling sparse delayed conversion signals and strict latency requirements.

    Model answerrecommendation systemsfeature engineeringdelayed feedbackmulti-task learning
  • Work through four sets of ML fundamentals: a Bayes' rule posterior with a rare event, neural network arithmetic, KNN concept checks, and Transformer mechanics.

    Model answerbayes-theoremneural-networksknntransformers
  • Design an end-to-end churn prediction system for a subscription business, choosing between windowed binary classifiers and time-to-event models, avoiding leakage, and turning scores into daily actions.

    Model answerchurn-predictionsurvival-analysisclass-imbalancedata-leakage
  • Design a full recommendation pipeline covering data ingestion, feature engineering, model training and refresh, multi-stage serving architecture, and production reliability.

    Model answerrecommendation systemsfeature storestwo-tower modelA/B testing
  • Implement cosine-similarity ranking over a set of candidate embeddings, handle edge cases explicitly, and reason through how you would evaluate whether the results are actually useful.

    Model answerembeddingssimilarityevaluationpython
  • Design and implement a generalized linear model end-to-end, covering family and link selection, loss derivation, numerical stability, and prediction semantics.

    Model answergeneralized-linear-modelsmaximum-likelihoodnumerical-stability
  • Diagnose stalled GPU utilization across storage, CPU transforms, and transfer, then design a bounded, reproducible prefetch pipeline.

    Model answerdata-loadinggpu-utilizationperformancetraining-infrastructure
  • Explain SFT's token-likelihood objective, DPO's pairwise log-ratio loss, and how PPO fits into KL-regularized post-training.

    Model answerpost-trainingDPOPPOSFT
  • Decide when a feature should use a model versus plain code, covering fit criteria, anti-patterns, AI-native design, and cost/trust trade-offs.

    Model answerproduct-senseml-strategyml-system-designai-native
  • Debug a telehealth triage service that returns wrong categories with negative confidence scores, then redesign the classification and escalation logic.

    Model answerml-debugginghealthcaresafety-criticalapi-design
  • Identify the data, modeling, optimization, and deployment flaws in a proposal to train a CNN on public images to predict structural failures and generate safe designs.

    Model answercomputer-visionmodel-evaluationadversarial-mlsystem-design
  • Describe one model you deployed in detail: formulation, features, training decisions, production issues, evaluation, and monitoring.

    Model answermodel-developmentproduction-mlfeature-engineeringevaluation
  • Diagnose a severe train/validation RMSE gap on tabular data, then select, prioritize, and experimentally validate three overfitting interventions without exceeding a 20 ms inference limit.

    Model answerregularizationoverfittinggradient-boostingfeature-engineering
  • Build an ML system that assigns incoming support tickets to the right engineering team, handling thousands of teams and high throughput.

    Model answerclassificationnlpproduction-mlretrieval
  • Design a retrieval-augmented assistant that answers multi-document questions over long regulatory filings with paragraph-level citations, streaming, and hallucination guards.

    Model answerragretrievalcitationsagentic-orchestration

More topics