What causes vanishing and exploding gradients, and how do you deal with them?
In a deep network, gradients are multiplied together across many layers during backpropagation, so if those factors are consistently below 1 the gradient shrinks toward zero by the time it reaches early layers, and if they are above 1 it blows up. ReLU-family activations, careful weight initialization (Xavier, He), batch or layer normalization, and residual connections all address this — which is part of why ResNets and transformers can be trained so much deeper than plain feedforward nets.