Deep-learning interviews test whether you can trace information and gradients through a model, calculate shapes and parameters, and diagnose training behaviour. The goal is not to recite architecture names.
The expanded 2026 bank keeps the core forward-pass, optimization, and debugging questions and adds Transformer scaling, KV caching, mixed precision, efficient attention, and modern training-efficiency topics.
This is the expanded interview-preparation version
Current, research-driven questions are shown first so you can immediately see what changed. Each question keeps the detailed answer, example, likely follow-up, and weak-answer warning.
What you will be able to do
- Trace forward and backward computation
- Calculate convolution shapes and parameter counts
- Compare activations, initialization, normalization, and optimizers
- Diagnose training curves
- Discuss architecture and deployment trade-offs
Training curves turn symptoms into hypotheses
Compare training and validation behaviour before changing the model
Use shapes, signals, and evidence
When describing a layer, state the input shape, transformation, output shape, learned parameters, and activation. When debugging, inspect data, loss, gradients, activations, modes, and learning rate before changing many hyperparameters at once.
19 interview questions with detailed answers
The 6 questions marked 2026 SIGNAL are shown first because they reflect current public big-tech interview patterns. Core fundamentals follow after them.
These were added or elevated from the latest research pass. They are intentionally placed before the older core bank so the update is visible immediately.
Recent Meta AI-engineer reports explicitly include self-attention complexity and efficient-attention follow-ups.
What is the computational complexity of self-attention, and why does sequence length matter?
Standard dense self-attention forms interactions between every pair of tokens, so attention score work and memory scale roughly with O(n²) in sequence length n.
The projection layers also depend on hidden size, but the quadratic token-token matrix becomes important for long contexts. Efficient attention implementations reduce memory traffic or approximate/sparsify interactions, depending on the method.
Transformer architecture remains a recurring ML/AI interview topic across Apple, Amazon, Meta, and Google-facing roles.
Encoder-only, decoder-only, or encoder-decoder Transformer: when would you use each?
Encoder-only models are natural for bidirectional representation tasks, decoder-only models for autoregressive generation, and encoder-decoder models for conditional sequence-to-sequence transformation.
The difference is largely attention masking and how source versus target tokens interact. Real systems may adapt any family, so explain the inductive bias rather than treating the categories as hard rules.
Current LLM-serving and concurrent-inference interview questions increasingly test KV-cache and throughput trade-offs.
What is a KV cache, and why does it speed autoregressive inference?
During generation, previous keys and values do not need to be recomputed at every token. A KV cache stores them so each new step reuses prior attention state.
Caching reduces repeated compute but consumes memory proportional to sequence length, layers, heads, and batch. Long contexts and many concurrent users can make KV memory the serving bottleneck.
Common deep-learning debugging follow-up in training-loop interviews.
Why use gradient clipping, and what problem does it not solve?
Gradient clipping caps gradient norm or values to prevent an unusually large update from destabilizing training; it does not fix a systematically wrong learning rate, broken loss, or bad data.
Global-norm clipping preserves gradient direction while limiting magnitude. If clipping fires on nearly every step, diagnose the architecture, optimizer, scale, normalization, or data rather than treating clipping as the permanent cure.
Practical ML-engineer loops increasingly probe GPU memory, throughput, and inference/training efficiency.
What changes when you train with mixed precision?
Mixed precision uses lower-precision arithmetic where safe to reduce memory and increase accelerator throughput while keeping sensitive operations or master weights at higher precision.
FP16 can underflow small gradients, so loss scaling is commonly used; BF16 has a wider exponent range and often needs less scaling. Always validate convergence and final quality, not only speed.
Relevant to vision and imbalanced deep-learning roles where class imbalance appears inside the loss.
When would you use focal loss instead of ordinary cross-entropy?
Focal loss down-weights easy well-classified examples so training focuses more on hard examples; it is useful when a huge number of easy negatives dominate the loss.
It adds a focusing factor such as (1-p_t)^gamma to cross-entropy. This changes optimization, so compare it against class weighting, sampling, and threshold strategies under the actual evaluation metric.
What does a neuron and a layer compute?
A neuron computes z=w·x+b and then an activation a=f(z). A layer evaluates many such learned projections in parallel.
Weights choose which input directions matter; bias shifts the threshold; a nonlinear activation prevents stacked layers collapsing into one linear map.
Trace a forward pass, loss, backward pass, and update.
Forward computes predictions, loss measures error, backprop applies the chain rule for gradients, and the optimizer updates parameters.
Gradients must be cleared between updates in frameworks that accumulate them. Training/evaluation modes also affect dropout and normalization.
Why are computational graphs and automatic differentiation useful?
A computation graph records operations and dependencies; autodiff reuses local derivatives in reverse order to compute many parameter gradients efficiently.
Reverse-mode differentiation is well suited when one scalar loss depends on many parameters. Detaching a tensor or using a non-differentiable operation can break the path.
How do you choose activation and output functions?
ReLU-like functions are common in hidden layers; sigmoid fits one binary probability; softmax fits mutually exclusive classes; regression output often remains linear.
The loss API may expect logits and apply sigmoid/softmax internally for numerical stability. Activation saturation can shrink gradients.
What causes vanishing or exploding gradients?
Repeated multiplication by small derivatives shrinks gradients; multiplication by large Jacobian norms grows them. Depth and long recurrence amplify both.
Initialization, activation, normalization, residual paths, gated recurrence, learning rate, and gradient clipping affect stability.
How do Xavier and He initialization differ?
Xavier is designed around roughly symmetric activations; He uses larger variance suited to ReLU-like units that discard negative activations.
Bad scale makes activations or gradients collapse or explode. Biases are commonly initialized to zero while weights must break symmetry.
Compare SGD, momentum, Adam, and learning-rate schedules.
SGD follows the current gradient; momentum smooths a running direction; Adam adapts steps per parameter. Schedules reduce or vary the global rate as training progresses.
Adam often reaches a useful solution quickly; tuned SGD can generalize well in some vision tasks. AdamW decouples weight decay from adaptive gradient scaling.
How do dropout, weight decay, early stopping, and augmentation differ?
Dropout perturbs hidden units, weight decay discourages large weights, early stopping limits fitting time, and augmentation expands plausible input variation.
Each encodes a different assumption. Dropout and augmentation behave differently in training and evaluation; validation must be held out.
BatchNorm versus LayerNorm—what changes?
BatchNorm uses batch statistics per feature and running statistics at inference; LayerNorm normalizes features within each example/token and does not depend on the batch.
Small or non-i.i.d. batches can make BatchNorm noisy. LayerNorm fits sequence models where token representations should behave consistently across batch sizes.
Calculate convolution output shape and parameters.
For one spatial dimension, output=floor((W−K+2P)/S)+1. Parameters=(K_hK_wC_in+1)C_out when each output channel has a bias.
Stride reduces resolution, padding can preserve it, and dilation expands receptive field without increasing kernel count.
RNN, LSTM/GRU, attention, or Transformer?
RNNs update sequential state; gates improve long-memory control; attention provides direct content-based interaction; Transformers parallelize training and scale attention-based blocks.
Sequence length, latency, memory, streaming requirements, and available data determine the choice. Attention cost can grow quadratically with sequence length.
How do transfer learning and staged fine-tuning work?
Start from a pretrained backbone, replace the task head, train the head while the backbone is frozen, then optionally unfreeze later blocks with a smaller rate.
Freezing preserves general features and lowers overfitting risk; staged unfreezing adapts representation when the target domain differs. Input preprocessing must match pretraining.
A network does not learn. What do you inspect first?
Verify a tiny clean batch can be memorized, then inspect labels, preprocessing, loss/output compatibility, gradient presence, learning rate, train/eval mode, and parameter updates.
The tiny-data test localizes implementation defects before expensive tuning. Track distributions and norms rather than only final accuracy.
Review the deeper lessons
Use these links when an interview question exposes a gap. The interview guide focuses on explanation and decision-making; the linked lesson teaches the full concept.
Keep the answer honest: role boundaries, interview processes, and project outcomes vary. Never invent experience, impact, salary, or certainty to make an answer sound stronger.
Summary / Key Takeaways
- Deep-learning answers should trace shapes, values, gradients, and parameter updates.
- Autodiff computes gradients; the optimizer applies updates within a correctly ordered loop.
- Activations, losses, and outputs must match the target and framework contract.
- Initialization, normalization, residual paths, clipping, and learning rate influence gradient stability.
- Regularization choices encode different assumptions and should respond to observed generalization gaps.
- Architecture selection depends on data structure, sequence length, latency, memory, and scale.
- A tiny-data memorization test is a powerful first check when a network will not learn.