All 214 Deep Learning interview questions
Neural networks, training tricks, CNNs, RNNs, transformers and everything in between.
Every question below opens on its own page, with a full answer, the formulas written out and a multiple-choice check. Free to read, no account needed.
Activations & fundamentals
- ReLU vs sigmoid vs GELU — when do you use each?easy
- In one sentence, what is backpropagation?easy
- State the universal approximation theorem in one sentence and its practical caveat.medium
- Why does stacking linear layers without nonlinearity collapse to a single linear layer?easy
- Depth vs width — which do you scale first?medium
- Why can't you initialize a neural net with all zeros?easy
- What is a computation graph and why does autograd care?easy
- What is 'dying ReLU' and how do you fix it?medium
- What are SiLU (Swish) and GELU, and why do transformers prefer them over ReLU?medium
- What does temperature do in a softmax?easy
- Why compute softmax + cross-entropy jointly via log-sum-exp?medium
- How should the output head be designed for a regression task with a strictly positive target?medium
- How is the output head different for multi-label vs multi-class classification?easy
- Do you need bias terms in every layer of a modern neural network?medium
- How do you compute the parameter count of a linear layer and a convolution?medium
- How do FLOPs scale for a forward pass through an MLP and a transformer?hard
- Why does tanh cause vanishing gradients in deep nets?medium
- What is a forward hook in PyTorch and when is it useful?easy
- In one sentence, what is broadcasting and why does it matter?easy
- Compute the output shape of a 2D convolution with input (H, W), kernel k, stride s, padding p, dilation d.medium
- Write the vanilla RNN update equation and explain why it struggles with long sequences.easy
- MSE vs MAE for regression — when is each preferred?easy
- Why is 'overfit a single batch' the first test you should run on a new model?easy
- The same training script gives different results on two runs. How much of that can you remove?medium
- What do residual connections actually fix?medium
Backpropagation & autograd
Initialization & gradients
- What are vanishing and exploding gradients, and how do you fix them?medium
- What is Xavier (Glorot) initialization and why?medium
- Why does He initialization use Var = 2 / fan_in instead of Xavier's 2 / (fan_in + fan_out)?medium
- When is orthogonal weight initialization useful?hard
- What causes exploding gradients and how do you handle them?medium
- Gradient clipping by norm vs by value — which do you prefer?easy
Training dynamics
- What does Batch Normalization do?medium
- How does dropout work and when is it applied?easy
- Why use a learning-rate schedule (warmup + cosine decay)?medium
- Why do residual (skip) connections help training deep networks?easy
- What is gradient accumulation and when do you use it?easy
- How does batch size affect training dynamics?medium
- What is deep double descent?hard
- What is grokking in deep learning?hard
- In one sentence, what is the Lottery Ticket Hypothesis?hard
- What is the 'implicit bias' of SGD?hard
- Your training loss becomes NaN. Debug it.medium
- What problem does LAMB solve?hard
- Describe the LR-range finder (Smith, 2015).easy
- What is the one-cycle policy?medium
- How should learning rate scale with batch size?medium
- What is gradient noise scale (GNS) and how do you use it?hard
- What is LARS and when is it used?hard
- Why does a model with BatchNorm behave differently at train time vs eval time?medium
- What is stochastic depth / DropPath and where is it used?medium
- What is early stopping and how do you configure it?easy
- What is Stochastic Weight Averaging (SWA)?medium
- How does snapshot ensembling work?medium
- What is adversarial training (PGD, FGSM)?hard
- How are input images typically normalized for pretrained CNNs?easy
- What is a solid default augmentation recipe for training a modern vision model?medium
- How should training resolution be chosen for a CNN or ViT?medium
- When do you use truncated BPTT and what's the trade-off?medium
- What is teacher forcing and its main pitfall?medium
- What is scheduled sampling?medium
- Contrast the pretraining objectives of BERT, GPT, and T5.medium
- What is deep supervision / auxiliary loss?medium
- How does mixed-precision training work with fp16 / bf16?medium
- Why does fp16 training need loss scaling?hard
- How does PyTorch DDP work under the hood?medium
- Model parallel vs data parallel — when do you need each?hard
- Explain the three ZeRO stages.hard
- How is FSDP different from DDP?hard
- What is an EMA of weights and why do modern training recipes use it?medium
- State the Chinchilla scaling insight in one sentence.hard
- Your validation loss is lower than your training loss. Is something broken?medium
- Your model trains well at batch size 256 but degrades at batch size 4. Why might batch normalization be the culprit?hard
- Your augmentation pipeline made validation accuracy worse. What went wrong?medium
- How does gradient accumulation let you train with a batch that does not fit in memory, and what does it not fix?medium
Optimizers
- SGD vs Adam vs AdamW — how do you choose?medium
- Write the vanilla SGD update rule and explain each term.easy
- How does classical momentum modify SGD?easy
- What is Nesterov momentum and how is it different from classical momentum?medium
- What is AdaGrad and its main drawback?medium
- How does RMSProp fix AdaGrad?medium
- Write Adam's full update rule.medium
- Why does AdamW work better than Adam + L2 weight decay for transformers?hard
- What is the Lion optimizer and why is it interesting?hard
- Why does Adafactor use less memory than Adam?hard
- What is Shampoo and when does second-order optimization pay off?hard
- How does weight decay change the objective and the update?medium
- How much extra memory does Adam use versus SGD?medium
- What does SAM (Sharpness-Aware Minimization) do?hard
- Why is weight decay via L2-in-loss different from decoupled weight decay in Adam?hard
- When do you prefer SGD with momentum over Adam?medium
- Why does AdamW handle weight decay differently from Adam, and why does it matter?hard
Learning-rate schedules
- What are cyclical learning rates (CLR)?medium
- Why do transformers need learning-rate warmup?medium
- What is cosine annealing and why is it preferred over step decay?medium
- When is step decay still appropriate?easy
- How does ReduceLROnPlateau work?easy
- What is SGDR (warm restarts) and when does it help?medium
- Why does transformer training usually need a learning-rate warmup?hard
Normalization
- When do you use LayerNorm instead of BatchNorm?medium
- What is GroupNorm and when do you use it?medium
- What is InstanceNorm and where does it shine?medium
- What is Weight Normalization and its trade-off?medium
- How does RMSNorm differ from LayerNorm?medium
- Pre-norm vs post-norm transformers — which is standard and why?hard
- What is Synchronized BatchNorm (SyncBN) and when do you need it?medium
- Why is BatchNorm awkward in RNNs?medium
- Why did transformers switch from post-norm to pre-norm at scale?hard
Regularization
- What is DropConnect and how is it different from Dropout?hard
- Where is dropout typically inserted in a transformer block?medium
- What is label smoothing and why does it help?easy
- How does Mixup work?medium
- What is Cutout / Random Erasing?easy
- Why is data augmentation effectively free regularization?easy
- What is consistency regularization?medium
- What is Manifold Mixup?hard
- Why does dropout play a smaller role in large language model training than in older vision models?hard
Data augmentation & mixing
Convolutional networks
- What inductive biases do CNNs have?medium
- What is the receptive field in a CNN?medium
- SAME vs VALID vs REFLECT padding — what are the practical differences?easy
- What is a dilated (atrous) convolution?medium
- What is a transposed convolution ('deconv') and its checkerboard artifact issue?hard
- How does a depthwise separable convolution reduce compute?medium
- What are 1x1 convolutions used for?easy
- Max pooling vs average pooling — when do you pick each?easy
- Why does Global Average Pooling replace the FC head in modern CNNs?medium
- What is adaptive pooling and why is it useful?easy
- What is ConvNeXt's philosophy?hard
CNN architectures
- What made AlexNet (2012) a breakthrough?easy
- What is the design principle behind VGG?easy
- What is the Inception module?medium
- What is the key insight of ResNet's identity mapping?medium
- How is DenseNet different from ResNet?medium
- What is MobileNet designed for?medium
- What is compound scaling in EfficientNet?hard
- How does a Vision Transformer (ViT) treat images?hard
- What does Swin Transformer do differently from ViT?hard
- How does a two-stage detector (Faster R-CNN) work?hard
- How does YOLO / SSD / RetinaNet differ from two-stage detection?medium
- What is Non-Maximum Suppression (NMS) and its variants?medium
- What are anchor boxes and their downsides?medium
- Why is U-Net so popular for segmentation?medium
- How does Mask R-CNN extend Faster R-CNN for instance segmentation?hard
- What is a Feature Pyramid Network (FPN)?hard
- How does DETR reformulate object detection?hard
- Describe a single transformer encoder block in detail.hard
- How does a decoder block differ from an encoder block?hard
- Encoder-only vs decoder-only vs encoder-decoder — when do you pick each?medium
- Explain focal loss and why it's used in dense detection.hard
- Write Dice loss and its role in segmentation.medium
- What is perceptual loss and why is it better than pixel-wise for image quality?medium
- What are the main ideas of StyleGAN?hard
- How does Latent Diffusion (Stable Diffusion) reduce compute?hard
- What are normalizing flows and their trade-off vs GANs / diffusion?hard
- What is Neural Architecture Search (NAS)?hard
Object detection & segmentation
Recurrent networks
- Why did transformers replace RNNs for sequence modeling?medium
- Explain the four gates of an LSTM.medium
- GRU vs LSTM — how are they different in practice?medium
- How does a bidirectional RNN work and when is it appropriate?easy
- What was Bahdanau attention and why was it a big deal?hard
- How does beam search work and what is its main failure mode?medium
- Why is length normalization needed in beam search?medium
- What is CTC loss and where is it used?hard
Attention & transformers
- How does self-attention work in a transformer?hard
- Why does a transformer need positional encoding?hard
- Why is attention scaled by 1/sqrt(d_k)?hard
- Why multi-head attention instead of a single big head?medium
- How do you pick the head dimension d_head?hard
- Why is standard self-attention O(n²) in sequence length?medium
- How do Performer / Linformer / linear attention reduce O(n²)?hard
- What is sparse / sliding-window attention?medium
- How do Longformer / BigBird combine sparse and global attention?hard
- What is Flash Attention?hard
- What is the KV cache in transformer inference?hard
- Explain sinusoidal positional encoding.medium
- What is the main limitation of learned absolute positional embeddings?medium
- How does relative positional encoding (Shaw / T5) work?hard
- How does ALiBi encode position?hard
- How does Rotary Position Embedding (RoPE) work?hard
- How does cross-attention differ from self-attention?medium
- How much can you interpret a model from attention weights?hard
- Briefly, what do BLEU and ROUGE measure?medium
- What are NTK-aware RoPE scaling and YaRN?hard
- How do you extend a transformer to very long contexts?hard
- Attention is quadratic in sequence length. Why is FlashAttention still a major win without changing that?hard
Losses for deep learning
- Write the Huber loss and explain when to use it.medium
- What is log-cosh loss and its advantage over Huber?medium
- Write binary cross-entropy for probability p̂ and label y ∈ {0, 1}.easy
- Multi-class cross-entropy vs one-vs-rest — pros and cons?medium
- Write the basic contrastive loss and when it's used.medium
- What is triplet loss and its main challenge?hard
- Write info-NCE / NT-Xent and its role in SSL.hard
- What is the standard reconstruction loss for autoencoders?easy
- Write the vanilla GAN's minimax objective.hard
- What does WGAN + gradient penalty change vs vanilla GAN?hard
- Write the VAE ELBO and explain each term.hard