Topic
Machine Learning interview problems
Modeling, evaluation, ML systems and LLM engineering. 510 original problems, each with a worked model answer.
27 easy273 medium210 hard
Showing 61–90 of 510 results
Diagnose and fix overfitting in linear and deep models, then explain self-attention (queries, keys, values, softmax weights) and why and how Transformers inject position information.
Model answeroverfittingregularizationtransformersself-attentionDesign a pipeline that models, estimates and corrects position bias in click-trained feed rankers, then evaluates a new ranker offline using only logged impressions.
Model answerposition-biaslearning-to-rankinverse-propensity-scoringcounterfactual-evaluationDesign a shopping-support assistant that answers product questions from a document index and checks order data through safe, typed tools, covering routing, guardrails, sampling and evaluation.
Model answerllm-agentsragtool-callingguardrailsDebug a small decoder-only transformer whose generation is wrong, add a KV cache, then derive and implement a custom matmul autograd op and discuss parallel scans.
Model answerpytorchtransformerkv-cacheautogradDesign a sponsored-post ranking system for a social feed: define the objective, choose features, evaluate offline, and monitor in production under a tight latency limit.
Model answerads-rankingcalibrationfeature-engineeringoffline-evaluationDesign a two-stage ML system that scores listing photos and predicts overall listing appeal to improve ranking and bookings, including targets, features, imbalance, cold start, metrics and fairness.
Model answerrankingcomputer-visioncold-startposition-biasRaise held-out accuracy of a fixed LinearSVC classifier using preprocessing, feature engineering and leak-free tuning, then justify the improvement credibly without touching the test set.
Model answerlinear-svmfeature-engineeringcross-validationdata-leakageDesign two ML ranking systems: one that suggests nearby places to a moving mobile user, and one that decides which push notifications to send, order, or suppress.
Model answerml-system-designrecommender-systemsrankingonline-servingDesign a retrieval-augmented question-answering assistant over internal company documents, with ML detail on each stage, document-level access control, grounded cited answers and failure handling.
Model answerragretrievalrerankingllm-fine-tuningDesign leak-safe preprocessing for zero-heavy counts, skewed money, a binary flag and two collinear measurements, and compare choices for linear, tree and k-NN models.
Model answerfeature-engineeringscalingmulticollinearitymissing-dataDesign an offline and online evaluation system for a retrieval-based enterprise assistant, covering retrieval, faithfulness, citations, abstention, access control, freshness and cost.
Model answerragllm-evaluationretrieval-metricsllm-as-judgeDesign an ML pipeline that scores bank-link attempts, identity checks, and transactions in real time, mapping risk to graded actions while keeping false positives low.
Model answerfraud-detectionml-system-designgraph-featuresimbalanced-dataA deep-dive technical interview covering model validation strategies, metrics, sequence model trade-offs (RNNs vs. Transformers), distribution shift detection, and optimizer selection.
Model answerevaluation metricssequence modelingdistribution shiftoptimizersDesign a plan to prove a smile detection feature in a photo app works, covering labels, metrics, hard cases, fairness, pipeline tests, rollout and monitoring.
Model answermodel-evaluationground-truthfairnessprecision-recallDefine the information content of a token, explain how the log base sets its unit, link it to cross-entropy and perplexity, and spot common mistakes when reading or comparing these numbers.
Model answerinformation-theorylanguage-modelingcross-entropyperplexityWrite a NumPy function that turns logits into probabilities, keeps the smallest top-ranked set whose mass reaches a threshold p, renormalizes, and draws one token index.
Model answernumpysamplingsoftmaxllm-decodingDescribe a machine learning project you led, covering problem, metrics, data, modeling, validation, deployment, your role, results and lessons, in a way a hiring panel can probe.
Model answerml-projectleadershipmetricsdeploymentDesign an end-to-end uplift system that picks which 20% of users get a free-delivery offer, covering experiments, modeling, evaluation, budgeted selection, fairness, interference and sequential testing.
Model answeruplift-modelingcausal-inferenceexperimentationqiniArchitect an end-to-end machine learning system to estimate customer renewal risk following service instability, covering feature selection, leakage, model tradeoffs, and decision thresholds.
Model answermachine learningchurn predictionfeature engineeringmodel evaluationDesign a low-latency, privacy-preserving system that reorders a user's inbox by importance and attaches faithful LLM-written digests to the most important threads.
Model answerml-system-designlearning-to-rankllm-summarizationprivacyDefine and evaluate a primary metric for an automated web threat detection system, balancing user protection, false alarm friction, and ground-truth validation strategies.
Model answerMetricsMachine LearningSystem DesignEvaluationAnswer five conceptual ML questions covering loss gradients, L1 vs L2 penalties, activations and dropout, cosine vs Euclidean similarity, and encoding high-cardinality categorical features.
Model answerloss-functionsregularizationdropoutcosine-similarityDescribe how group-relative policy optimization trains a language model from scored samples without a critic, how it compares with PPO-based RLHF, and where it breaks.
Model answerreinforcement-learningllmgrpoppoDesign an ML system that ranks and safely explores ads under one week old with little click or conversion history, while keeping auction pricing, user experience and advertiser pacing intact.
Model answercold-startads-rankingthompson-samplingcalibrationArchitect an end-to-end Machine Learning ad recommendation system for a content feed, balancing ad revenue with user experience, delayed feedback, counterfactual evaluation, and budget pacing.
Model answerrecommender-systemsrankingctr-predictionmulti-task-learningExplain how to quantify labeler reliability beyond raw agreement, when each metric fails, and how to decide whether an LLM can stand in for human graders.
Model answerinter-annotator-agreementcohens-kappakrippendorff-alphallm-as-judgePresent a vision-language model you built, covering scope, architecture, data, training, modularity, serving latency, and failure modes, with consistent numbers and clear trade-offs.
Model answervision-language-modelsmultimodalllm-traininginference-latencyWrite PyTorch components for a decoder-only GPT model, specifying tensor shapes and handling causal masking, multi-head attention, and block architecture.
Model answertransformersdeep-learningpytorchnlpExplain how to diagnose and curb overfitting, how contrastive pretraining and its loss shape embeddings, and how a transformer block works.
Model answeroverfittingcontrastive-learninginfoncetransformersExplain and design a per-layer key/value cache for decoder-only LLM generation, covering batching, branching, long contexts, memory and kernel performance, precision, and common correctness bugs.
Model answertransformerskv-cachellm-inferenceattention