The gauntlet
Every interview question from across the series, in one place — with the answer that lands and, where it matters, the thing the interviewer is listening for underneath the words.
Use it as a drill, not a script. An answer you have memorised sounds like an answer you have memorised; the point of the fifteen lessons is that you can rebuild each of these from the mechanism if you have to.
Twenty minutes of "explain X". They are not checking whether you memorised a definition — they are checking whether you can pick the right level of abstraction for the person asking, and whether you know where the concept breaks.
How to answer
Answer in three beats: the mechanism in one sentence, why it exists (what it fixed), and one failure mode. Then stop and let them steer.
"Your model isn't learning / the loss is NaN / train is 99% and validation is 70%." This is the round that most reliably separates people who have trained something from people who have read about it.
How to answer
Work top-down from cheap checks to expensive ones: is the data right, is the loss right, is the learning rate sane, is there leakage, is the split honest. Say what you'd look at and in what order.
"Precision or recall? Bigger model or more data? Fine-tune or retrieve?" There is no correct answer and they know it. They want to hear you name the cost of each error type and pick from that.
How to answer
Always ask what a mistake costs before answering. Then commit to a position — a candidate who won't choose reads as worse than one who chooses and explains the conditions under which they'd switch.
"Design a fraud detection system / a recommender / a support triage assistant." Modelling is maybe a fifth of it. Data, labels, evaluation, serving, monitoring and rollback are the rest.
How to answer
Spend the first minute establishing whether it should be ML at all, then the requirements: volume, latency, cost of each error type. Ship a stupid baseline in your design before the neural network.
If you only prepare ten
These recur across essentially every published question list and every real loop. Each links back to the lesson that builds the answer from first principles.
Say the answer out loud before you flip the card. Out loud matters — the gap between knowing something and being able to say it under mild pressure is most of what an interview measures.
How would you explain machine learning to a non-technical stakeholder?
From rules to learning
The full bank
Normally we write the rules and the computer applies them. With ML we show the computer thousands of solved examples and it derives the rules itself. That's why it can do things we can't write down — like recognising a face — and also why it's never exactly right, only right often enough, which is why we measure it instead of testing it.
What they're listening for
They're checking you can say 'never exactly right' without flinching. Candidates who over-promise determinism fail this one.
Three checks. Is there a deterministic rule that solves it — if yes, ship that. Can I define and measure 'correct' on held-out data — if no, there's no project yet. Do I have (or can I afford) labelled examples at the volume this needs? Then I'd cost the inference bill per request, because that's a forever cost, and compare it to the value of one correct decision.
What they're listening for
The strongest answers start with 'can we avoid ML' and end with unit economics.
Under the definition of its era, yes — it played chess better than any human. Under a learning definition, no: its evaluation function was hand-tuned by grandmasters and it improved only when engineers edited it. It's the clearest example that AI is the goal and ML is one route to it.
Rebuild it from the mechanismAny information in training that wouldn't exist at prediction time. Detection: implausibly high scores, a single feature dominating importance, a large gap between offline and online metrics. Prevention: build every fitted transform into a pipeline, split by time or group, and for each feature ask 'would I know this value at the moment I have to predict?'
What they're listening for
Naming target, temporal and preprocessing leakage as distinct categories reads as experience rather than reading.
Start with the pre-trained model — self-supervised representations already learned from the large corpus, then fine-tune or few-shot on the 500. Otherwise: semi-supervised approaches, active learning to spend the labelling budget on the examples nearest the decision boundary, and heavy cross-validation because a single holdout of 500 gives a hopelessly wide confidence interval.
Rebuild it from the mechanismBy time, forward-chaining — fraud patterns are adversarial and non-stationary, so a random split trains on the future and flatters the model. I'd also group by account so the same fraudster can't appear on both sides, and stratify to keep the (very low) positive rate representative in each fold.
Rebuild it from the mechanismElement-wise multiply the input vector by a learned weight vector, sum, add a bias — that's the pre-activation z = w·x + b — then apply a non-linear activation. The weights are learned sensitivities, the bias is an intercept, and the non-linearity is what lets stacked layers represent more than a straight line.
Rebuild it from the mechanismReLU or a smooth variant like GELU. Sigmoid's derivative maxes out at 0.25, so gradients shrink at least four-fold per layer and deep stacks stop learning; tanh is better because it's zero-centred but still saturates. ReLU's gradient is 1 in the active region, so the signal survives depth, and it's cheap. I'd keep sigmoid for a binary output and for gating inside an LSTM.
What they're listening for
Quoting the 0.25 derivative peak is the detail that separates memorised answers from understood ones.
512 × 256 weights plus 256 biases = 131,328. Worth doing out loud — interviewers use this to check you can reason about model size and memory before you reach for a profiler.
Rebuild it from the mechanismDepends what 'good' means. MSE fits the conditional mean and hates large misses, so it's right if a 40-minute miss is disproportionately worse than four 10-minute misses. MAE fits the median and gives a typical delivery time, which is usually what a customer-facing ETA wants. In practice I'd use Huber, or train quantile losses to give a range rather than a point — an ETA with a p90 is a better product than an ETA with an average.
What they're listening for
Mentioning quantile regression for an ETA problem is the answer that gets remembered.
First change the metric — accuracy is meaningless here, so precision-recall AUC and recall at a fixed precision. Then set the threshold from the cost of each error type rather than leaving it at 0.5. Then consider class weights or focal loss, knowing they'll distort calibration. Resampling only inside the training fold. And I'd hold out by time, since imbalanced problems like fraud are usually non-stationary too.
Rebuild it from the mechanismŷ − y — the predicted distribution minus the one-hot truth. The softmax Jacobian and the log cancel, which is exactly why the pair is used together and why frameworks fuse them into one op for stability.
Rebuild it from the mechanismCompute how the loss changes with respect to each parameter — that's the gradient — then move every parameter a small step in the opposite direction, because the gradient points uphill. Repeat over mini-batches. The step size is the learning rate, and it's the hyperparameter that decides whether you converge, crawl or diverge.
Rebuild it from the mechanismAdam by default: it adapts a per-parameter rate so it works without much tuning, which matters when you have one shot at a training run. AdamW specifically for transformers, because decoupled weight decay regularises properly. But well-tuned SGD with momentum still generalises slightly better on some vision benchmarks, so if I had budget for a sweep and a fixed architecture, I'd compare rather than assume.
What they're listening for
Knowing that Adam isn't automatically better is the differentiator; most candidates answer 'Adam, it's adaptive' and stop.
At the start, Adam's second-moment estimates come from a handful of samples and are unreliable, so early large steps can destabilise a model that hasn't found any structure yet. Ramping from near zero over the first few thousand steps lets those estimates settle, then cosine decay takes it down for fine convergence.
Rebuild it from the mechanismMuch less than the textbook picture suggests. In very high dimensions a critical point must curve upward in every direction to be a local minimum, which is exponentially unlikely — so nearly all critical points are saddles. Momentum and mini-batch noise get you off saddles. The real practical problems are plateaus, ravines and a badly chosen learning rate.
Rebuild it from the mechanismThe network is a computation graph. The forward pass computes the output and caches intermediates. The loss gives one number. The backward pass starts with ∂L/∂L = 1 and walks the graph in reverse: each node multiplies the gradient arriving from downstream by its own local derivative and hands the result to its inputs. Because every node only needs its local derivative, one reverse sweep produces the gradient for every parameter at about the cost of one forward pass. The optimiser then applies those gradients.
What they're listening for
Say 'chain rule applied locally on a graph' and 'one reverse sweep, cost of one forward pass'. Those two phrases carry the whole answer.
Two reasons. Optimisation: the additive identity path lets the gradient flow backwards without being multiplied by a chain of weight matrices, so vanishing is much less severe and depth beyond twenty layers becomes trainable. Representation: each block only has to learn a residual correction to the identity, which is an easier function to learn than the full mapping — so adding depth can't make things much worse.
Rebuild it from the mechanismNot overfitting — that would show as worse validation with better training. Worse training accuracy with more depth is the degradation problem: optimisation difficulty from vanishing gradients and a harder loss surface. Fixes: residual connections, normalisation layers, He initialisation, and checking the learning rate, since deeper networks often need a lower one.
Rebuild it from the mechanismExpected squared test error decomposes into bias² + variance + irreducible noise. Bias is error from over-simple assumptions — the model is wrong even on average. Variance is sensitivity to the specific training sample — the model changes a lot if you resample. Capacity trades one for the other, which classically gives a U-shaped test-error curve. The nuance for large networks is double descent: past the interpolation threshold error can fall again.
Rebuild it from the mechanismThe gap between training and validation performance, and its trend. If validation loss bottoms out and starts climbing while training loss keeps falling, that's the moment. I'd also check that the validation split is honest — with a time-ordered or grouped problem, a random split can hide overfitting completely by leaking near-duplicates across the boundary.
What they're listening for
Adding 'and check the split is honest' is what a practitioner says. It's the failure that produces confident, wrong conclusions.
It's disabled. During training you zero a fraction p of activations and scale the survivors by 1/(1−p) so expected activation is unchanged; at inference all units are active with no scaling. Leaving dropout on at eval makes predictions noisy and metrics inconsistent — in PyTorch that's forgetting model.eval(). The exception is deliberate: keeping dropout on across many forward passes (MC dropout) as a cheap uncertainty estimate.
Rebuild it from the mechanismNo — with a 0.1% fraud rate, predicting 'never fraud' scores exactly that. I'd want the confusion matrix, precision and recall at the operating threshold, average precision rather than ROC-AUC because of the imbalance, and the money: what fraud value is caught versus what legitimate volume is blocked. Accuracy on an imbalanced problem tells you the base rate, not the model.
Rebuild it from the mechanismFrom the cost of each error type, not from 0.5. Estimate the cost of a false positive and a false negative, then pick the threshold minimising expected cost — or fix the constraint the business actually has, like 'maximise recall subject to precision ≥ 90%' because that's the review capacity. Better still, use two thresholds and send the uncertain band to a human.
What they're listening for
The two-threshold answer — auto-approve, auto-decline, human middle — is the one that reads as having shipped a real system.
Candidates: the offline set doesn't reflect live traffic (stale, or a random rather than time-based split); the metric improved somewhere users don't feel it — for example better on the tail while the head is unchanged; a feedback loop, where the offline set was collected under the old model's policy; latency regression eating the quality gain; or the experiment is underpowered and 'flat' just means not yet significant. I'd check the power calculation before concluding anything.
Rebuild it from the mechanismBecause architecture is inductive bias, and the right bias is worth enormous amounts of data. An MLP assumes nothing about the input's structure, so it must learn locality, translation invariance and sequence order from examples. A CNN gets locality and weight sharing for free and needs orders of magnitude fewer parameters for images. The MLP is the most general architecture and, for structured data, that generality is a cost rather than a feature.
What they're listening for
'Architecture is inductive bias' is the sentence that signals you understand why the family tree exists.
Gradient-boosted trees, almost certainly — LightGBM or XGBoost. They handle mixed types and missing values natively, train in minutes, need much less tuning, and on tabular data of this size they typically match or beat a neural network. I'd run logistic regression as a baseline first, then GBDT, and only consider a network if I needed to fuse text or image features alongside the table.
Rebuild it from the mechanism224 × 224 × 3 = 150,528 inputs, times 1,000 units, plus 1,000 biases — about 150.5 million parameters in one layer. That arithmetic is the whole motivation for convolution, where a 3×3×3 kernel is 27 weights reused at every position.
Rebuild it from the mechanismTwo structural assumptions that match the data. Local receptive fields, because pixels relate to their neighbours, so features come from small patches. And parameter sharing, because a cat is a cat anywhere in the frame, so the same kernel is reused at every position. Together they cut parameters by orders of magnitude and give translation invariance for free, instead of forcing the network to learn it from examples.
Rebuild it from the mechanismTake 224×224×3 in. Conv 3×3, 64 channels, padding 1, stride 1 → 224×224×64, with (3·3·3+1)·64 = 1,792 parameters. Max pool 2×2 → 112×112×64, no parameters. Conv 3×3, 128 channels → 112×112×128, with (3·3·64+1)·128 = 73,856 parameters. Pool again → 56×56×128. Note the parameter counts don't depend on resolution — only on kernel size and channel counts.
What they're listening for
Doing the arithmetic out loud, including the +1 for bias, is what they're checking. Vagueness here reads as never having built one.
Depends on data scale. With a large dataset or strong pretrained weights, ViTs generally win — weaker inductive bias, so they learn better priors when there's enough data, and attention relates distant regions in one step. With modest data and no pretraining, a CNN's built-in locality and translation invariance substitute for the data you don't have. In practice I'd start from pretrained weights either way and let a validation comparison decide.
Rebuild it from the mechanismParallelism, primarily. An RNN's hidden state at step t depends on step t−1, so training is inherently sequential and can't be spread across hardware. A transformer computes all positions at once during training, so throughput scales with compute — which is what made internet-scale pretraining possible. Secondarily, attention connects any two positions in one hop, while an RNN has to carry information through every intervening step, so long-range dependencies are learned far better.
What they're listening for
Lead with parallelism, not accuracy. Candidates who lead with 'attention is better at long context' have half the answer.
Three sigmoid gates over an additively-updated cell state. Forget decides what fraction of the existing cell state to keep. Input decides what part of the new candidate to write in. Output decides how much of the cell state becomes this step's hidden output. The key structural point is that the cell state is modified only by multiplication by a gate and addition — no repeated weight-matrix multiply — which is why gradients survive many timesteps.
Rebuild it from the mechanismStreaming or on-device inference with tight latency and memory, where a constant-size state beats a growing KV cache; short sequences where a transformer's overhead isn't repaid; and small datasets where the recurrent inductive bias helps. I'd also mention state-space models like Mamba, which revive linear-time recurrence with parallelisable training and are a live alternative for very long sequences.
Rebuild it from the mechanismProject each token into a query, key and value. Score every query against every key by dot product to get an n×n relevance matrix, scale by √dₖ so the softmax doesn't saturate, softmax each row into weights, and take the weighted average of the values. Every position ends up as a blend of the whole sequence, weighted by learned relevance. Because all positions compute independently, it parallelises — that's the advantage over recurrence.
Rebuild it from the mechanismBecause generation is autoregressive: token t is an input to producing token t+1, so you can't compute them simultaneously. Each step attends over everything before it, which is why the KV cache exists — you store previous keys and values rather than recomputing them. That makes serving memory-bandwidth-bound rather than compute-bound, and it's what grouped-query attention and speculative decoding are attacking.
What they're listening for
This question separates people who've served a model from people who've read about one.
As a diagnostic, cautiously; as a faithful explanation, no. Attention weights show where information was gathered from, but the value vectors, the feed-forward blocks and the residual stream all shape the output, and there's published work showing you can alter attention distributions substantially without changing the prediction. I'd use them for debugging and reach for attribution methods if I needed an explanation I could defend.
Rebuild it from the mechanismAttention mixes information across positions; the feed-forward network processes each position independently, expanding to about 4× the model dimension and projecting back. It's where most of the block's parameters live, and there's good evidence it functions as key-value memory storing a lot of the model's factual knowledge. Attention moves information around; the MLP is where much of it is stored.
Rebuild it from the mechanismTraining cost is a one-off; inference cost is paid on every request forever. Chinchilla-style scaling says you can reach the same loss with fewer parameters and more tokens for the same training compute — and then serve it more cheaply, with lower latency and smaller memory footprint, for the life of the product. That's why the industry trains well past compute-optimal.
What they're listening for
Framing it as unit economics rather than benchmark scores is the answer that gets you the systems conversation.
Partly a measurement artefact. Sharp jumps often come from discontinuous metrics like exact-match accuracy; measure the same task with a continuous metric and improvement looks smooth. That said, there are real qualitative changes in what's usable at scale. I'd say capability improves smoothly and usefulness crosses thresholds — and I'd choose continuous metrics when evaluating, so I can see progress before it crosses one.
Rebuild it from the mechanismEmbed every product image with a CLIP-style encoder once, offline, into a vector index. At query time embed the user's text — or their uploaded photo — into the same space and take nearest neighbours. It's zero-shot, so it handles queries nobody enumerated, and the same index serves both text-to-image and image-to-image search. I'd measure recall@k against a labelled query set, and keep keyword search alongside it, because embeddings are weak on exact identifiers like SKUs.
What they're listening for
Adding 'keep keyword search alongside' shows you know where dense retrieval actually fails.
The training objective never required it. Contrastive caption matching rewards getting the gist right — a caption saying 'some sheep' matches a photo of any number of sheep — so precise counting is not something the loss ever pushed on. It's a good illustration of the general rule: models are good at what the loss measured, not at what you assumed it implied.
Rebuild it from the mechanismOnly when the sequence of steps genuinely can't be determined up front — open-ended research, debugging, anything where the next action depends on what the last one returned. If I can enumerate the steps, I write the workflow: it's cheaper, deterministic, far easier to evaluate, and it fails in ways I can debug. I'd also insist on a step budget, a cost cap and a human gate before anything irreversible.
What they're listening for
Interviewers are listening for someone who will not build an agent by default. Reaching for the constrained pattern is the signal.
Task success rate on a fixed suite of realistic scenarios, first — end-to-end, not per-step. Then the operational metrics the loop introduces: steps per task, cost per task, tool error rate, and how often it hits the step limit. Then trajectory-level review of failures to see whether the model chose wrong tools or the tools returned bad data. It's the same discipline as evaluating a classifier, with a harder-to-score output, so I'd build the eval set before the agent.
Rebuild it from the mechanismWhere each claim above comes from. Open them alongside the lesson rather than after it — the papers are shorter than you think, and the figures usually carry the whole argument.
External links open in a new tab. Every URL was reachable when this page was written; links rot, so treat the list as a map rather than a guarantee.
Built by Braj Kishore — an engineering leader who has run a good number of these loops from the other side of the table.