Topic
Machine Learning interview problems
Modeling, evaluation, ML systems and LLM engineering. 511 original problems, each with a worked model answer.
27 easy274 medium210 hard
Showing 301–330 of 511 results
Design a complete ML system to classify incoming email as spam or legitimate, covering labeling, features, models, serving, metrics, and adversarial defenses.
Model answerml-system-designclassificationproduction-mlanti-abuseDesign an end-to-end ML system that scores payment transactions in real time and decides whether to approve, block, challenge, or escalate them.
Model answerfraud detectionfeature engineeringimbalanced learningonline servingImplement causal multi-head attention from scratch, add a KV cache for step-by-step decoding, then extend it to grouped-query attention where query heads share KV heads.
Model answertransformersattentiondeep-learningDesign and compare algorithms for detecting near-duplicate content at scale, then layer on signals that distinguish organic sharing from coordinated inauthentic behavior.
Model answernear-duplicate detectionsimilarity hashingembeddingsclusteringFit an OLS model on financial panel data, interpret each coefficient in economic terms, and test whether each extra feature adds explanatory power.
Model answerlinear-regressionstatistical-inferencefeature-selectiontime-seriesDesign a production-grade batch inference system that runs a language model over millions of daily documents with exactly-once semantics, versioning, and operational reliability.
Model answerbatch inferenceMLOpssystem designfault toleranceDesign a provenance-tracked hybrid retrieval system over text PDFs and chart images, with reranking, ACL/PII controls, calibrated abstention, and staged evaluation.
Model answerragmultimodalretrievalhybrid-searchDesign an ML ranking system for a short-term rental platform where candidates are pre-filtered and there is no free-text query to match against.
Model answerrankingrecommendationpersonalizationbiasDesign an ML-powered pipeline to automatically discover and classify personal information across billions of records in structured tables and unstructured text.
Model answerml-system-designprivacydata-pipelinellmDesign an ML pipeline that classifies each vehicle at an intersection as turning left, going straight, or turning right, given a short trajectory history and optional map context.
Model answerautonomous-drivingsequence-modelingsystem-designDevelop both a linear baseline and a tree-based classifier for predicting loan defaults, covering feature engineering, validation, calibration, and deployment.
Model answerclassificationimbalanced-datamodel-calibrationscikit-learnDesign an ML inference API that serves predictions in milliseconds, handling multitenancy, model rollouts, monitoring, and graceful degradation.
Model answerml-systemsinferencelatencyproduction-mlDefine KL divergence, explain its asymmetry and support requirements, and walk through how it appears in language model training and alignment.
Model answerkl-divergencelanguage-modelsrlhfinformation-theoryDerive the cross-entropy objective for binary logistic regression from first principles and compute its gradients with respect to parameters.
Model answerlogistic-regressionmaximum-likelihoodgradientsregularizationWalk through scaled dot-product attention, KV-cache memory and complexity, mixed-precision training with loss scaling vs BF16, and masked vs cross-attention design choices.
Model answertransformersattentionkv-cachemixed-precisionDesign an end-to-end CTR prediction pipeline covering temporal feature engineering, leakage prevention, high-cardinality encoding, and offline-to-online metric gaps.
Model answerfeature-engineeringdata-leakagehigh-cardinalitymodel-evaluationSystematically locate and repair common implementation errors in a decoder-only Transformer, then add per-layer key-value caching to make autoregressive generation efficient.
Model answertransformersattentionkv-cachedebuggingDesign a production ML system that assigns products to a noisy, multi-path category tree with consistent predictions, calibrated confidence, and sub-100ms latency.
Model answerhierarchical classificationmulti-labeltaxonomyloss functionsExplain the gap between offline validation and live model performance to a non-technical PM, covering causes, a diagnostic plan, and mitigations with trade-offs.
Model answermodel degradationdata driftproduction MLstakeholder communicationImplement a trainable n-gram language model with smoothing and sampling, then reason through how to pick the right n for your data.
Model answernlplanguage-modelsmoothingperplexityDesign and defend a complete GenAI system from data ingestion to production serving, covering model choice, evaluation, safety, and a scaling plan under hard latency and cost constraints.
Model answerLLMRAGfine-tuningservingExplain how KNN works for classification and regression, walk through its key design choices, and identify where it breaks down in practice.
Model answerknndistance-metricshyperparameter-tuningcurse-of-dimensionalityDesign an end-to-end ML system that decides whether a natural-language query should go to a lightweight local assistant or a powerful cloud LLM.
Model answersystem-designnlpclassificationexperimentationDerive Cook's distance from first principles, build a diagnostic workflow, show how one point can flip a coefficient's sign, and compare robust regression alternatives.
Model answerregressiondiagnosticsrobust-statisticscook-distanceDesign an ML pipeline that fuses camera, LiDAR, and radar data to detect obstacles with sub-100ms latency on edge hardware.
Model answerml-systemscomputer-visionsensor-fusionedge-mlDesign a production-ready ML pipeline to identify free-tier merchants likely to convert to a paid subscription within 60 days, covering labeling, leakage, features, modeling, evaluation, and monitoring.
Model answersupervised-learningfeature-engineeringtime-series-leakagemodel-calibrationDesign the data pipeline, grounding architecture, hallucination and safety evaluation, and fairness controls for a clinical Q&A assistant that must never diagnose.
Model answerragllm-safetyevaluationhealthcareDesign an agent that generates and optimizes GPU kernels and compiler passes, covering validation strategy, correctness checks, numerical tolerances, and performance evaluation.
Model answerml-systemscompilersgpuagentsDesign a low-latency system that surfaces the most relevant K venues within a moving map viewport, covering spatial indexing, candidate retrieval, personalized re-ranking, and caching.
Model answerml-system-designgeospatialretrievalrankingDesign a system that decides, per request, how many candidates to pass from the recall stage to the heavy ranker in a recommender system.
Model answerrecommender systemsretrieval-rankingcompute optimizationML system design