Topic
Machine Learning interview problems
Modeling, evaluation, ML systems and LLM engineering. 509 original problems, each with a worked model answer.
27 easy273 medium209 hard
Showing 1–30 of 509 results
Work through agreement, classification and ranking metrics, TF-IDF, reproducibility and model comparison for a document classification and search system, showing the arithmetic.
Model answerevaluation-metricsnlprankingcohens-kappaArchitect an end-to-end time-series forecasting solution covering data preparation, baseline and advanced models, multi-step strategies, non-leaky validation, and drift management.
Model answertime-seriesforecastingsystem-designmachine-learningAnalyze multi-town daily temperature data: define volatility and similarity metrics, fit and validate a regression, run greedy town selection, and derive batch and streaming no-intercept slopes.
Model answerregressiontime-seriesfeature-selectiononline-learningAnalyze structural trade-offs in LLM subword tokenization and explain the mathematical role of KL constraints during model alignment.
Model answerLLMTokenizationNLPFine-TuningDesign 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.
Model answerrecommendation-systemssequential-recommendationreal-time-mlsystem-designExplain 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.
Model answerprecision-recallclassification-thresholdimbalanced-datacalibrationDesign 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.
Model answerdata-leakagepreprocessingpipelinesvalidationDesign, evaluate, monitor and roll out a weekly-horizon churn model on a shaky data foundation, covering leakage, time-aware validation, drift detection, retraining rules and fairness.
Model answerml-pipelinechurn-predictiondata-leakagedrift-detectionDesign a low-latency recommender that proposes the next file a user will open while keeping each company's data isolated and respecting constantly changing file permissions.
Model answerrecommender-systemsmulti-tenancyaccess-controlcold-startDecide when a product classifier should favor precision or recall, and explain how to set its decision threshold using error costs, capacity limits, class imbalance, and post-launch monitoring.
Model answerprecision-recallthreshold-selectioncost-sensitive-learningclass-imbalanceA deep dive into diagnosing and fixing model overfitting alongside a statistical breakdown of Mean Squared Error loss and its alternative objectives.
Model answeroverfittingregularizationloss-functionsregressionDiagnose subtle implementation errors in PyTorch multi-head attention blocks and build an end-to-end data analysis and model evaluation workflow.
Model answertransformersdeep-learningnlppytorchWrite a multi-head attention module from raw tensor ops: projections, head reshaping, scaled scores, masking, softmax, and output merge, plus cost and testing discussion.
Model answerattentiontransformerspytorchmaskingPerform a comprehensive data quality audit, leakage check, and data contract design for an aviation dataset intended for delay prediction.
Model answerdata-qualityfeature-engineeringdata-pipelinesmachine-learningWrite a fully connected layer and a numerically stable row-wise softmax as Python classes in NumPy, paying attention to shapes, broadcasting and overflow.
Model answernumpyneural-networkssoftmaxbroadcastingExplain and contrast Query-Key-Value representations for cross-attention mechanisms in candidate-aware recommendation systems.
Model answertransformersattentionrecommendation-systemsdeep-learningAnswer a set of short core machine-learning questions covering models, regularization, evaluation, optimization and ranking, framed around building a product recommendation system.
Model answermachine-learningfundamentalsregularizationevaluationExplain how a dual-encoder image-text model is trained and used, compare contrastive losses, and discuss embedding retrieval weaknesses, alternatives, and popularity bias.
Model answermultimodalcontrastive-learningdense-retrievalpopularity-biasExplain how an LLM agent invokes tools, keeps calls well-formed, recovers from bad calls, and stops runaway tool loops, with concrete engineering trade-offs.
Model answerllm-agentstool-callingstructured-decodingreliabilityDesign an end-to-end forecasting pipeline for a noisy time series: frame the target, avoid leakage, choose a model, write a PyTorch training loop, and evaluate it with time-aware validation.
Model answertime-seriesforecastingpytorchleakageDesign a read-only, retrieval-grounded LLM system that summarizes case files, builds timelines, flags conflicting statements, and drafts briefs with verifiable citations and strong isolation.
Model answerragllm-system-designprompt-injectioncitation-verificationDesign a regression pipeline that estimates residential sale prices, covering missing data, categorical encoding, feature ideas, time-aware validation, metrics, and interpretability.
Model answerregressionfeature-engineeringtime-series-validationtarget-encodingWrite a multi-head self-attention module with Q/K/V projections, scaled scores, and a causal mask so each token sees only itself and earlier tokens, then explain how it works.
Model answertransformersattentionpytorchcausal-maskingDesign a system that forecasts stop service times with ML and feeds them to a constrained optimizer to split a shift's deliveries across drivers, balancing punctuality and fairness.
Model answeroptimizationgradient-boostingcold-startdistribution-shiftDesign two ML systems end to end: a regression model forecasting flight departure lateness two hours out, and an open-set face-matching pipeline that flags watchlist individuals at a bank entrance.
Model answerregressionlabel-leakagetime-series-validationimbalanced-classificationDefine evaluation criteria, data sampling plans, and rollout gates for introducing a machine learning feature on edge devices.
Model answerproduct-metricsevaluationedge-computingmodel-launchDesign an ML pipeline that screens uploaded images, captions and links for spam, phishing and unsafe imagery within a tight latency budget while keeping false positives low.
Model answerml-system-designcontent-moderationclassificationclass-imbalanceExplain why gradients shrink or blow up with depth and time, and design a combined fix using activations, initialization, skip connections, normalization, and gated or attention-based sequence models.
Model answervanishing-gradientsinitializationresidual-connectionsnormalizationDecode a sequence from a bigram-style probability table using greedy search and beam search, and justify choices on ties, dead-ends, cycles, and length normalization.
Model answerbeam-searchgreedy-decodingsequence-modelslog-probabilityArchitect 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