Questions
The senior ML interview canon
191 questions across 9 categories. Each with what L4 / L5 / L6 answers actually sound like, the tells that get a strong-hire vote, and the tells that get you down-leveled. Press / to search.
ML Fundamentals 8
- Bayesian vs frequentist: a practitioner's framing
The textbook distinction is philosophical. The practitioner distinction is whether you can sample from a posterior cheaply, and whether you need uncertainty for downstream decisions.
- Explain backprop in your own words
Backprop is reverse-mode automatic differentiation. It reuses forward-pass values to compute all parameter gradients at roughly one additional forward-pass cost.
- How do you choose a learning rate?
The right answer is a procedure, not a number. The wrong answers are 'use the default' and 'try a few values.'
- How do you choose a loss function?
Choose a loss from the target, noise model, error cost, and output constraints. A well-trained model still fails when its objective is wrong.
- L1 vs L2 regularization, beyond the formula
The math is identical to most candidates: penalty terms in the loss. The senior signal is the Bayesian interpretation, the optimization geometry, and when each is the right choice.
- Walk me through the bias-variance tradeoff
The classic warm-up question. The L4 answer is the formula; the L6 answer is what it tells you about model selection in production.
- When would you not use cross-validation?
Cross-validation is a tool, not a default. The senior answer names the cases where it's wrong, expensive, or misleading.
- Why does dropout work?
The trick is that there are three valid explanations and they all matter. Which ones you reach for tells the interviewer your level.
Math & Research 7
- Critique an ML paper you have not seen before
A research-depth framework for claims, baselines, evidence, leakage, compute fairness, ablations, and generalization.
- Derive logistic regression from MLE
Standard math-screen question. The senior signal is whether you can derive it cleanly and connect MLE to cross-entropy.
- Derive ML math under oral-interview pressure
A strong derivation states assumptions, exposes the key identity, checks the result, and explains what it means for model behavior.
- Design an ablation study that tests the claimed mechanism
Separate a model improvement from extra compute, data, parameters, tuning, and implementation confounds.
- Explain the reparameterization trick
How VAEs propagate gradients through a sampling step. The senior answer explains the why (you can't differentiate through a sample) and the how (move the randomness outside the parameters).
- Investigate a black-box model behavior in 90 minutes
Turn an observation into competing hypotheses, discriminating probes, boundary conditions, and one decision-changing result.
- Why is softmax + cross-entropy the right pairing?
The gradient simplifies to (p - y), and that's not a coincidence. The senior answer derives this and connects to GLMs and numerical stability.
ML Implementation 13
- Debug a frontier LLM training run that suddenly diverges
A loss spike is an incident: preserve evidence, classify the failure, isolate the first bad transition, and recover without hiding the cause.
- Debug this training loop
A live coding question with a paste of buggy training code. The senior signal is the order in which you find bugs and what your debugging procedure looks like.
- Extend an unfamiliar ML codebase with an AI coding agent
The new coding signal is control: map the system, delegate bounded work, reject bad changes, and prove the result.
- Implement a LoRA adapter for a frozen linear layer
The code is small; the signal is low-rank parameterization, zero-impact initialization, scaling, trainable-state control, and deployment trade-offs.
- Implement a pre-norm Transformer decoder block
The code tests tensor contracts, causal masking, stable attention, residual structure, and whether you can connect a toy block to production kernels.
- Implement attention from scratch
The coding question that doubles as a depth check. The code is short; the conversation around it tells the level.
- Implement beam search with EOS and length normalization
The implementation tests bounded hypothesis state, log-probability accounting, finished-sequence handling, and whether the decoder fits the task.
- Implement incremental decoding with a KV cache
Prove that one-token cached attention matches full-prefix attention while preserving shape, dtype, growth, and memory invariants.
- Implement KNN efficiently
The naive solution is one line. The interview is about scaling: when does naive fail, and what do you do?
- Implement memory-bounded batched top-k retrieval
Retrieve top-k cosine neighbors for many queries without materializing the full query-by-item score matrix.
- Implement mergeable streaming classification metrics
Build a bounded-memory confusion-matrix accumulator with merge, precision, recall, F1, and edge-case handling.
- Implement reverse-mode autodiff for scalar expressions
Build the computation graph, local derivatives, gradient accumulation, and reverse topological pass behind neural-network training.
- Optimize an accelerator workload from a trace
Performance engineering is a measured argument: identify the bottleneck, predict the effect, preserve correctness, and shorten the critical path.
ML System Design 11
- Design a content moderation system
Moderation is a multi-policy classification problem at scale, with appeals, human review, and adversarial users. The senior answer separates policy from model and treats human review as part of the system.
- Design a feature store from scratch
A feature store solves training-serving skew, feature reuse, and lineage. The senior answer explains why each property matters and what minimum viable looks like.
- Design a foundation-model data platform
A deep case on lawful sourcing, provenance, curation, contamination, mixtures, high-throughput processing, deletion, release gates, incidents, and multi-level technical judgment.
- Design a multi-team ML platform
A staff-level case covering platform scope, data contracts, training, deployment, governance, migration, ownership, cost, and adoption across product teams.
- Design a production LLM inference service
Turn prefill, decode, KV memory, admission, batching, fairness, overload, and cost into one explicit serving policy.
- Design a real-time multimodal assistant
A deep system-design case covering synchronized live media, streaming models, latency, failure recovery, privacy, evaluation, rollout, incidents, and multi-level technical decisions.
- Design an ML system under a fixed serving budget
A cost-constrained system-design question where quality, latency, traffic, and annual spend must fit one defensible operating point.
- Design fault-tolerant distributed training
Classify fail-stop, straggler, state-divergence, and silent-corruption failures before choosing restart, elasticity, redundancy, or repair.
- Design fraud detection for a payment company
Fraud has the worst data of any ML problem: heavily imbalanced, biased labels, adversarial actors, and direct money on the line. The senior answer respects all four.
- Design ML monitoring
Most ML systems fail silently. Monitoring is what tells you. The senior answer monitors data, model, and outcome layers separately.
- Design real-time personalization
Real-time personalization fails most often at the data infrastructure, not the model. The senior answer designs the feature freshness and serving stack first.
Product & Experimentation 4
- Choose metrics for an ML product
Select a primary outcome, guardrails, diagnostics, and decision horizon without turning the dashboard into a metric zoo.
- Design an A/B test for a new ML model
Turn an offline model gain into a valid product decision: unit, exposure, power, guardrails, interference, and a ship rule.
- How do you A/B test a chatbot?
Chatbot A/B testing has all the hard parts of regular A/B testing plus delayed feedback, conversational state, and metrics that are hard to define.
- Your offline metric improved but the online metric got worse. Debug it.
A senior experimentation question about objective mismatch, leakage, serving skew, feedback loops, and disciplined diagnosis.
Deep Learning Production 8
- Explain backprop through time
BPTT is just backprop on the unrolled computation graph of a recurrent network. The interview signal is whether you understand truncation and what it costs.
- How do you deal with class imbalance in 2026?
Match the treatment to the imbalance ratio, error costs, label process, and decision metric. Class weighting and SMOTE are only two options.
- How would you debug a model that's not learning?
The 'tell me how you'd debug' question is a behavioral round in disguise. The interviewer is probing your debugging instinct, not testing facts.
- Mixed precision: what's actually happening?
Beyond 'use BF16'. The senior answer explains what stays in FP32, why loss scaling exists for FP16, and the memory split.
- Plan and cost a 70B transformer training run
Turn a model configuration and cluster budget into parameters, memory, parallelism, time, and an experiment plan.
- Train and serve a reasoning model under a fixed compute budget
A deep system-design case on allocating fixed accelerator capacity across reasoning-model training, verification, evaluation, routing, serving, reliability, and organizational ownership.
- Walk me through how you'd train a 100B parameter model
The question is about parallelism and memory, not about modeling. The L6 answer combines data, tensor, pipeline, and FSDP/ZeRO sharding into a coherent strategy.
- Why does Adam sometimes generalize worse than SGD?
Adam usually trains faster but in some settings finds sharper minima with worse generalization. The senior answer names the regimes where this happens and the modern fixes.
LLM Systems 16
- Build an LLM coding assistant from scratch
The architecture decision space is large: model choice, context retrieval, IDE integration, evals. The senior answer scopes the use case before any of it.
- Design a RAG system for legal documents
Legal RAG amplifies every standard RAG concern: precise citations, no hallucinations, regulated domain, dense documents with structure. The senior answer addresses each.
- Design a safety control plane for high-impact agents
A deep case on independent runtime controls, safety cases, monitors, circuit breakers, approval, evidence, degraded operation, incidents, evaluation, and upper-IC judgment.
- Design a system for safe LLM deployment in healthcare
Healthcare adds three constraints on top of normal LLM deployment: regulatory compliance, low tolerance for harm, and a workflow that already has clinicians as the final decision-maker.
- Design an AI coding product
A deep system-design case covering four coding modes, repository context, safe execution, evaluation, developer control, rollout, cost, and organization-wide technical decisions.
- Design an enterprise agent platform
A deep architecture case covering delegated authority, tool contracts, durable state, safe retries, memory, evaluation, observability, rollout, cost, and multi-organization governance.
- Design an LLM red-team and security evaluation program
Start from assets and attacker capability, test the whole agentic system adaptively, and turn findings into measurable release gates.
- Design post-training data, an RL environment, and its grader
Turn one capability into episodes, evidence-bearing graders, adversarial data, and a training signal that cannot reward the wrong process.
- Fine-tuning vs prompting: the deep version
Past the basic decision tree. The senior answer covers SFT, LoRA, DPO, continued pretraining, and the operational trade-offs each introduces.
- How do you evaluate an agent?
Agent eval is harder than chat eval because there are intermediate steps, tool calls, and long-horizon outcomes. The senior answer evaluates trajectories, not just final outputs.
- How do you handle hallucinations in production?
There is no single solution. The senior answer is a layered system that catches different hallucination types at different stages.
- How would you build evals for a coding assistant?
Code is one of the few LLM domains where ground truth is verifiable. Use that. The senior answer combines verifiable metrics with human review for what verification can't catch.
- How would you evaluate an LLM application you've built?
A level-defining question. The same words elicit a junior, senior, or staff answer. The rubric below shows the differences.
- How would you reduce LLM inference cost by 10x?
The cost-engineering question. The L6 answer doesn't pick a technique, it diagnoses where the cost is, then picks five.
- Walk me through speculative decoding
The interview signal is whether you understand why decoding is memory-bound and why the verify pass is essentially free.
- When would you fine-tune vs prompt vs RAG?
The most-asked LLM design question of 2026. The answer is a decision tree, not a preference.
Recsys & Search 9
- Design Amazon's people also bought
A simple-sounding feature with deep recsys ground underneath. The senior answer chooses between item-item collaborative filtering, embedding similarity, and learned co-purchase models, with explicit handling of feedback loops.
- Design short-form video recommendation for ecosystem health
A deep recommendation case balancing viewer value, creator opportunity, quality, revenue, concentration, experimentation, operations, and portfolio choices across a short-form video ecosystem.
- Design Spotify's homepage
A multi-shelf, multi-objective recommendation surface. The senior answer scopes the shelves first, then designs each as its own ranker with a meta-layer above.
- Design YouTube's recommender
The canonical recsys design question. The real test is whether you'll dive into model architecture or scope the problem first.
- How would you do cold-start for a new user?
Cold-start is solved by combining minimal explicit signal, demographic and contextual fallbacks, and aggressive exploration in the first few sessions.
- How would you evaluate a search ranker?
Search ranking eval is offline metrics for development, A/B for shipping, and human raters for absolute calibration. The senior answer uses all three and respects what each measures.
- Negative sampling strategies: what actually matters
Choice of negatives often matters more than choice of model. The senior answer ranks the strategies (in-batch, hard, BM25-mined, model-mined) and explains the trade-offs.
- Recsys in the LLM era: what changes?
Most of recsys hasn't changed; LLMs add new capabilities at specific stages. The senior answer names which stages benefit and which don't.
- Two-tower vs cross-encoder: when to use which?
The recsys / search architecture decision that comes up in every retrieval interview. The right answer is 'both, in sequence.'
Behavioral 9
- Defend a values decision under ethical pressure
A strong mission answer names competing goods, makes a costly choice, exposes uncertainty, and shows what evidence changed your behavior.
- How do you decide what to work on?
The senior signal here is that you have an explicit prioritization framework, not just a list of interests. The L6 answer connects user value, technical leverage, and team strategy.
- How do you scope an ambiguous problem?
Scoping is a core senior skill. The interview tests how you reduce ambiguity before choosing a model or system design.
- Present a technical ML project and defend it under questions
A senior project presentation should expose three decisions, one failure, honest attribution, and enough depth to survive interruption.
- Tell me about a time you advocated for quality or safety over speed
A senior behavioral question about evidence, proportionate pushback, stakeholder pressure, and responsible trade-offs.
- Tell me about a time you disagreed with someone senior
The standard behavioral question. The interviewer is checking whether you can hold technical positions, push back productively, and update on new information.
- Tell me about an ML project you killed or redirected
A staff-level behavioral and project question about sunk costs, evidence thresholds, influence, and responsible stopping.
- Tell me about your most ambitious project
The interview is checking the size of problem you can hold in your head and the structure of how you describe it. Specificity wins.
- What's the most over-rated technique in ML right now?
A trap question that rewards taste. Strong opinions, defended with reasoning, are the senior signal. Weak opinions or 'I don't know' both lose.
Other
- 3Sum
Return every unique group of three numbers whose sum is zero.
- Alien Dictionary
Infer character order from words that are sorted in an unknown alphabet.
- Balanced Binary Tree
Check whether the child heights at every node differ by at most one.
- Best Time to Buy and Sell Stock
Buy once, then sell later. Return the largest profit.
- Binary Precision and Recall
Compute precision and recall from binary labels and predictions.
- Binary Search
Find a target in a sorted array.
- Binary Tree Level Order Traversal
Return tree values one level at a time.
- Binary Tree Maximum Path Sum
Find the largest sum of any connected path in a binary tree.
- Causal Attention
Compute one attention head where each token can read only itself and earlier tokens.
- Climbing Stairs
Count ways to reach step `n` using moves of one or two steps.
- Clone Graph
Make a deep copy of a connected graph.
- Coin Change
Find the fewest coins needed to make an amount.
- Combination Sum
Return combinations that add to a target. A value may be used more than once.
- Combination Sum IV
Count ordered sequences of values that add to the target.
- Construct Tree From Preorder and Inorder Traversal
Rebuild a binary tree from its preorder and inorder value lists. Values are unique.
- Container With Most Water
Pick two heights that hold the most water.
- Contains Duplicate
Check whether any value appears more than once.
- Count Number of Nice Subarrays
Count subarrays that contain exactly `k` odd numbers.
- Counting Bits
Return the set-bit count for every value from 0 through `n`.
- Course Schedule
Check whether all courses can be completed.
- Course Schedule II
Return one valid order for completing every course.
- Cross-Entropy From Logits
Compute mean multiclass cross-entropy from logits and integer labels.
- Daily Temperatures
For each day, find how many days pass before a warmer temperature.
- Decode String
Decode text such as `3[a2[c]]` into `accaccacc`.
- Decode Ways
Count ways to decode digits where `1` through `26` map to letters.
- Design Add and Search Words
Store words and support `.` as a wildcard that matches any one character.
- Edit Distance
Find the fewest insert, delete, or replace steps needed to change one string into another.
- Encode and Decode Strings
Convert a list of any strings into one string and recover the exact list.
- Find Median From Data Stream
Add numbers one at a time and return the current median.
- Find Minimum in Rotated Sorted Array
Find the smallest value in a sorted array that was rotated once.
- Graph Valid Tree
Check whether undirected edges form one valid tree.
- Group Anagrams
Put words with the same letters into the same group.
- House Robber
Find the most money that can be taken without choosing neighboring houses.
- House Robber II
Houses form a circle, so the first and last houses are neighbors.
- Implement Trie
Support word insert, full-word search, and prefix search.
- Insert Interval
Insert one range into sorted, non-overlapping ranges and merge when needed.
- Invert Binary Tree
Swap the left and right children at every node.
- Jump Game
Check whether jumps can reach the last array position.
- Koko Eating Bananas
Find the slowest eating speed that finishes all piles within the time limit.
- Kth Largest Element
Find the `k`th largest value in an unsorted array.
- Kth Smallest Element in a BST
Return the `k`th smallest tree value.
- Largest Rectangle in Histogram
Find the largest rectangle that fits under histogram bars.
- Linked List Cycle
Check whether a linked list contains a cycle.
- Longest Common Subsequence
Find the longest sequence of characters that appears in two strings in the same order. Characters do not need to be next to each other.
- Longest Consecutive Sequence
Find the length of the longest run of consecutive values in an unsorted array.
- Longest Increasing Path in a Matrix
Find the longest path that moves to a larger neighboring value each step.
- Longest Increasing Subsequence
Find the longest strictly increasing subsequence. Values do not need to be next to each other.
- Longest Palindromic Substring
Return the longest continuous palindrome in a string.
- Longest Repeating Character Replacement
Replace at most `k` letters so the longest possible substring has one repeated letter.
- Longest Substring Without Repeating Characters
Find the longest substring with no repeated character.
- Lowest Common Ancestor in a BST
Find the lowest node whose subtree contains both target nodes.
- LRU Cache
Support `get` and `put` in constant time. Remove the least recently used item when the cache is full.
- Maximum Depth of Binary Tree
Find the number of nodes on the longest root-to-leaf path.
- Maximum Product Subarray
Find the largest product of a nonempty continuous subarray.
- Maximum Subarray
Find the largest sum of a nonempty continuous subarray.
- Meeting Rooms
Check whether one person can attend every meeting.
- Meeting Rooms II
Find the smallest number of rooms needed for all meetings.
- Merge Intervals
Merge every pair of overlapping ranges.
- Merge K Sorted Lists
Merge many sorted linked lists into one sorted list.
- Merge Two Sorted Lists
Merge two sorted linked lists into one sorted list.
- Min Stack
Build a stack that returns its current minimum in constant time.
- Mini-Batches
Split examples into batches without dropping the final short batch.
- Minimum Window Substring
Find the shortest substring that contains all required characters and counts.
- Missing Number
Values come from 0 through `n`, with one missing. Return the missing value.
- Network Delay Time
Find when a signal from one node reaches every node in a weighted directed graph.
- Non-overlapping Intervals
Find the fewest ranges to remove so the rest do not overlap.
- Number of 1 Bits
Count the set bits in an integer.
- Number of Connected Components
Count separate groups in an undirected graph.
- Number of Islands
Count connected groups of land in a grid.
- Pacific Atlantic Water Flow
Find cells whose water can reach both oceans.
- Pad Variable-Length Sequences
Put integer sequences into one rectangular array and return a valid-token mask.
- Pairwise Squared Distances
Compute the squared distance from every point to every center without Python loops.
- Palindromic Substrings
Count every continuous palindrome in a string.
- Partition Equal Subset Sum
Check whether the values can be split into two groups with equal sums.
- Permutation in String
Check whether any substring has the same letter counts as the pattern.
- Permutations
Return every possible ordering of the input values.
- Product of Array Except Self
For each position, return the product of all other values. Do not use division.
- Redundant Connection
Find the edge that creates a cycle in an undirected graph.
- Remove Nth Node From End
Remove the `n`th node counted from the end.
- Reorder List
Change `1, 2, 3, 4, 5` into `1, 5, 2, 4, 3`.
- Reverse Bits
Reverse the 32 bits of an unsigned integer.
- Reverse Linked List
Reverse all links in a singly linked list.
- Rotate Image
Rotate a square matrix 90 degrees clockwise in place.
- Rotting Oranges
Find how many minutes all reachable fresh oranges need to rot.
- Same Tree
Check whether two binary trees have the same shape and values.
- Search in Rotated Sorted Array
Find a target in a sorted array that was rotated once.
- Serialize and Deserialize Binary Tree
Convert a tree to text and rebuild the same tree from that text.
- Set Matrix Zeroes
If a cell is zero, set its full row and column to zero. Change the matrix in place.
- Spiral Matrix
Return matrix values in spiral order.
- Split Array Largest Sum
Split an array into `k` nonempty continuous parts. Make the largest part sum as small as possible.
- Stable Softmax
Convert logits to probabilities without numeric overflow.
- Subarray Sum Equals K
Count continuous subarrays whose sum equals the target.
- Subsets
Return every subset of the input values.
- Subtree of Another Tree
Check whether one full tree appears inside another tree.
- Sum of Two Integers
Add two integers without `+` or `-`.
- Top K Frequent Elements
Return the `k` values that appear most often.
- Top-K Scores
Return indices of the `k` largest scores in descending score order.
- Two Sum
Return the indices of two numbers that add to the target.
- Unique Paths
Count paths from the top-left to bottom-right when moves can only go right or down.
- Valid Anagram
Check whether two strings contain the same letters with the same counts.
- Valid Palindrome
Ignore punctuation and letter case, then check whether text reads the same both ways.
- Valid Parentheses
Check whether all brackets close in the correct order.
- Validate Binary Search Tree
Check whether every node follows all BST ordering rules.
- Word Break
Check whether a string can be split into dictionary words.
- Word Search
Check whether a word can be formed by neighboring board cells without reusing a cell.
- Word Search II
Find every dictionary word that can be formed on a letter board.