ML & Deep Learning Foundations
Every AI Engineer loop - frontier lab, big tech, or startup - still opens with fundamentals: interviewers use them to separate people who operate models from people who understand them. Expect these questions in phone screens, as warm-ups before system design, and as depth probes when you claim LLM experience ("you fine-tuned a model - why AdamW?
Card 1 of 15
Generalization: bias, variance, and the modern caveat
Bias is error from a model too simple to capture the signal; variance is error from fitting noise in a particular training set. Under squared-error loss, expected test error decomposes exactly as bias² + variance + irreducible noise (for other losses the decomposition is only an analogy). Diagnose with the train/val gap: high train error = underfitting (bias); low train error but high val error = overfitting (variance). The modern caveat: heavily overparameterized networks violate the classical U-shaped curve (double descent) - past the interpolation threshold, bigger models often generalise better, which is part of why scaling works.
Regularization toolkit (know what each one trades away):
- L2 / weight decay - shrinks weights toward zero; MAP estimation with a Gaussian prior.
- L1 - drives weights exactly to zero (sparsity); Laplace prior.
- Dropout - randomly zeroes activations at train time (rescaled so inference needs no change); an implicit ensemble. Large-scale LLM pretraining often sets it to 0 because data is effectively unlimited.
- Early stopping - halt when val loss stops improving; cheap and surprisingly close to L2 in effect.
- Data augmentation - encodes invariances (crops/flips in vision, paraphrase/back-translation in NLP).
All 55 ML & Deep Learning Foundations questions
Basic
- Explain the bias-variance tradeoff. How do you tell which one is hurting your model?
- How do you detect overfitting and underfitting in practice, and what do you do about each?
- Compare L1 and L2 regularization. Why does L1 produce sparse weights?
- How does dropout work - and what changes between training and inference?
- Walk me through train/validation/test splits. When do you use cross-validation, and when is it a bad idea?
- Explain precision, recall, and F1. Give a concrete case where 99% accuracy means the model is useless.
- What's the difference between parameters and hyperparameters? How do you tune hyperparameters efficiently?
- What's the difference between batch, mini-batch, and stochastic gradient descent? What does batch size actually change?
- What are embeddings? Compare cosine similarity, dot product, and Euclidean distance - when does the choice matter?
- Define supervised, unsupervised, and self-supervised learning. Where does each stage of modern LLM training fit?
- Random forest vs gradient boosting: how does each work, and why do tree ensembles still beat neural networks on tabular data?
- What is feature scaling? Compare normalization and standardization, and tell me which models actually need it.
- Walk me from RNNs to LSTMs to transformers. Why did attention win?
- What is the difference between feature engineering and representation learning? Where does hand-engineering still earn its keep in 2026?
- Why does a neural network need non-linear activation functions, and how did the field move from sigmoid to ReLU to GELU-style activations?
Intermediate
- What is data leakage? Give me three subtle examples you've seen or could imagine, and how you'd detect them.
- ROC-AUC vs PR-AUC - what does each measure, and why does ROC-AUC look deceptively good on imbalanced data?
- What does it mean for a classifier to be calibrated? How do you measure and fix miscalibration?
- Your fraud dataset is 0.5% positive. Walk me through your strategy for handling the imbalance.
- Explain momentum and Adam. What problem does each solve over vanilla SGD?
- Adam vs AdamW - what exactly is "decoupled weight decay," and why did AdamW become the transformer default?
- Why do transformer training recipes use learning-rate warmup, and what does the rest of the schedule look like?
- Explain backpropagation to me like I'm a strong software engineer who's never done ML. Why is it efficient?
- What are vanishing and exploding gradients? What causes them, and what does modern architecture design do about them?
- Why can't you initialize all weights to zero? What do Xavier and He initialization actually do?
- Batch norm vs layer norm: how does each work, and why do transformers use layer norm?
- Derive cross-entropy loss from first principles. Why is it "the right" loss for classification and language modeling?
- Explain softmax and the temperature parameter. How do you compute softmax stably, and where does temperature show up across ML?
- Compare PCA, t-SNE and UMAP. When would you use each, and how do people misread these plots?
- Your new model scores 87.2% on the test set, the incumbent scores 86.5%. Ship it?
- What is training-serving skew? How do you detect it and how do you design it out?
- You're running an A/B test on a new model. Walk me through designing it, and tell me what you'd refuse to do once it's live.
- About 10% of your training labels are wrong. What happens, and what do you do about it?
- You're adapting a pretrained model to a new task. What do you freeze, what do you train, and how do you decide?
- What goes wrong when you validate a model on time-ordered data, and how do you do it properly?
- How do you choose k in clustering, and how do you evaluate a clustering when you have no labels?
- What is conformal prediction, and how would you use it to put a statistical guarantee on a classifier's or an LLM pipeline's outputs?
- A stakeholder asks which features drive your gradient-boosted model. Compare built-in importance, permutation importance and SHAP, and tell me where each one misleads.
Advanced
- Why is MSE a bad loss for classification, even though it "works"? Connect it to the probabilistic view of loss functions.
- Explain contrastive learning and the InfoNCE loss. How are modern embedding models (CLIP, text retrievers) actually trained?
- Beyond L1/L2: explain early stopping, data augmentation, and label smoothing as regularizers. What is regularization, really?
- What kinds of distribution shift exist, and how would you monitor a deployed model - classical or LLM-based - for them?
- When does cosine similarity mislead you? Discuss embedding-space pathologies relevant to retrieval systems.
- What is maximum likelihood estimation? Show how it generates the standard loss functions, and where the Bayesian view (MAP) connects to regularization.
- What is double descent, and how does it change the classical story about model size and overfitting?
- Your LLM pretraining loss just spiked. Talk me through training stability: gradient clipping, mixed precision, and your debugging playbook.
- Design the evaluation for a fraud model at 0.1% prevalence, end to end: metrics, thresholding, validation protocol, and monitoring.
- Your model hits 0.87 AUC offline, you launch it, and the business metric doesn't move. Debug it.
- Attention vs convolution: compare them as inductive biases, and tell me what that implies for architecture choice.
- Your churn model has 0.9 AUC. Product wants to send retention discounts to the top 5%. Why might that be a bad plan?
- Your model meets quality but runs at 4s p95 and you need 400ms with 10x the throughput. Design the compression plan.
- You have 10M unlabelled examples and budget for 20k labels. How do you spend it?
- Why do ensembles work, when are they worth the cost, and where do they show up in LLM systems?
- What is the Muon optimizer, how does it differ from AdamW, and why have some frontier pretraining runs adopted it?
- What is superposition in neural networks, and how do sparse autoencoders try to recover interpretable features from it? Where have they fallen short?