In a neural network, the vanishing gradient problem is MOST commonly associated with which activation function?
Answer: B
The sigmoid activation function squashes inputs into the range (0,1). Its derivative is at most 0.25, so during backpropagation through many layers, gradients are repeatedly multiplied by values less than 1, causing them to shrink exponentially — this is the vanishing gradient problem. ReLU and Leaky ReLU were introduced partly to mitigate this issue.
Q.2Medium
Which of the following best describes the role of the 'stride' parameter in a Convolutional Neural Network (CNN)?
Answer: B
Stride specifies the number of pixels by which the convolutional filter shifts across the input at each step. A stride of 1 moves the filter one pixel at a time, while a stride of 2 moves it two pixels, effectively reducing the spatial dimensions of the output feature map.
Q.3Medium
In the context of Batch Normalization, what is normalized during the forward pass of training?
Answer: C
Batch Normalization normalizes the activations (pre- or post-activation) of a layer by computing the mean μB and variance σB2 over the current mini-batch. The normalized value is x^=σB2+ϵx−μB, which is then scaled and shifted by learnable parameters γ and β.
Q.4Medium
What is the primary purpose of the 'dropout' regularization technique in deep learning?
Answer: B
Dropout randomly sets a fraction p of neuron activations to zero during each training forward pass. This prevents co-adaptation of neurons, forcing the network to learn more robust and distributed representations. At inference time, all neurons are active, and weights are scaled by (1−p) to compensate.
Q.5Medium
Which optimizer uses both the first moment (mean) and the second moment (uncentered variance) of gradients to adapt the learning rate for each parameter?
Answer: D
Adam (Adaptive Moment Estimation) maintains exponentially decaying moving averages of past gradients mt (first moment) and past squared gradients vt (second moment). The update rule is θt+1=θt−v^t+ϵηm^t, combining the benefits of momentum and RMSProp.
Q.6Medium
In an LSTM (Long Short-Term Memory) network, which gate is responsible for deciding what information to discard from the cell state?
Answer: C
The forget gate in an LSTM uses a sigmoid activation to output values between 0 and 1 for each element of the cell state Ct−1. A value near 0 means 'forget this', while a value near 1 means 'keep this'. It is computed as ft=σ(Wf⋅[ht−1,xt]+bf).
Q.7Medium
The output size of a convolutional layer is given by ⌊sn+2p−f+1⌋, where n is the input size, p is padding, f is filter size, and s is stride. For an input of size 32×32, filter 5×5, padding 0, and stride 1, what is the output size?
Answer: B
Applying the formula: ⌊132+2(0)−5+1⌋=⌊127+1⌋=28. So the output feature map is 28×28.
Q.8Medium
Which of the following is the key architectural difference that distinguishes a Transformer model from a traditional RNN?
Answer: B
The core innovation of the Transformer architecture is the self-attention mechanism, which allows every token in a sequence to attend to every other token simultaneously. This parallelism overcomes the sequential dependency of RNNs/LSTMs, enabling much faster training and better capturing of long-range dependencies.
Q.9Medium
In transfer learning for deep neural networks, which approach is most commonly used when the new dataset is small but similar to the original dataset?
Answer: B
When the target dataset is small and similar to the source dataset, the pre-trained convolutional base already contains relevant feature representations. Freezing these weights prevents overfitting on the small dataset, while training only the final classifier head adapts the model to the new task with minimal risk of overfitting.
Q.10Medium
The cross-entropy loss for a multi-class classification problem with C classes is defined as L=−∑c=1Cyclog(p^c). If the true label is class 2 (one-hot: [0,1,0]) and the predicted probabilities are [0.1,0.7,0.2], what is the loss?
Answer: C
In the cross-entropy formula L=−∑c=1Cyclog(p^c), only the term corresponding to the true class contributes since yc=0 for all other classes. Here the true class is class 2 with y2=1 and p^2=0.7, so L=−(1⋅log(0.7))=−log(0.7)≈0.357.
Q.11Medium
In a Generative Adversarial Network (GAN), what is the objective of the discriminator during training?
Answer: B
In a GAN, the discriminator acts as a binary classifier. Its goal is to correctly identify whether a given sample is real (from the true data distribution) or fake (generated by the generator). The generator tries to fool the discriminator, while the discriminator tries to resist being fooled — this adversarial dynamic drives training.
Q.12Medium
Which of the following activation functions is most prone to the 'dying ReLU' problem, where neurons output zero for all inputs and stop learning?
Answer: C
The ReLU (Rectified Linear Unit) activation function outputs zero for all negative inputs. If a neuron's weights cause it to always receive negative pre-activation values, the gradient through it becomes zero permanently, and the neuron never updates — this is called the 'dying ReLU' problem. Leaky ReLU was introduced to address this.
Q.13Medium
In backpropagation through time (BPTT) used for training RNNs, what is the primary computational challenge when dealing with very long sequences?
Answer: B
In BPTT, gradients are multiplied repeatedly through many time steps. If the gradient magnitudes are less than 1, repeated multiplication causes them to shrink exponentially (vanishing gradients), making it hard to learn long-range dependencies. If greater than 1, they grow exponentially (exploding gradients). Techniques like gradient clipping, LSTMs, and GRUs were developed to mitigate these issues.
Q.14Medium
The receptive field of a neuron in a deep CNN refers to which of the following?
Answer: B
The receptive field of a neuron is the region of the original input (e.g., pixels in an image) that can affect the value of that neuron. In deeper layers, neurons have larger receptive fields because each layer aggregates information from a broader spatial region of the previous layer. Designing networks with large effective receptive fields is important for capturing global context.
Q.15Medium
Which of the following best describes 'weight sharing' in Convolutional Neural Networks?
Answer: B
In CNNs, a single convolutional filter slides (convolves) across the entire spatial extent of the input, using the same set of weights at every location. This property is called weight sharing. It drastically reduces the number of learnable parameters compared to a fully connected layer and exploits the translation invariance property of images.
Q.16Medium
In the context of deep learning, what does the term 'hyperparameter' refer to?
Answer: B
Hyperparameters are configuration settings that govern the training process and model structure — they are set before training and are not learned from data. Examples include learning rate, number of layers, number of neurons per layer, batch size, and dropout rate. In contrast, weights and biases are parameters learned during training via gradient descent.
Q.17Medium
Which of the following pooling operations is most commonly used in CNNs and retains the most prominent feature within a pooling window?
Answer: C
Max pooling selects the maximum value within each pooling window. This operation retains the most prominent (strongest) activation in a local region, making the network more robust to small translations and distortions. It also introduces a degree of spatial invariance. Max pooling is the most widely used pooling type in standard CNN architectures.
Q.18Medium
What is the key idea behind residual connections (skip connections) introduced in ResNet?
Answer: B
Residual connections add the input x of a block directly to its output F(x), so the block learns the residual F(x)=H(x)−x rather than the full mapping H(x). If the optimal mapping is close to the identity, it is easier to push F(x) toward zero than to learn the identity directly. This also helps gradients flow through the network unimpeded, enabling training of very deep networks (100+ layers).
Q.19Medium
In the attention mechanism used in Transformers, the scaled dot-product attention is computed as Attention(Q,K,V)=softmax(dkQKT)V Why is the scaling factor dk1 applied?
Answer: B
When dk (the dimension of the keys) is large, the dot products QKT can become very large in magnitude. Large input values to the softmax function lead to extremely small gradients (the softmax output becomes nearly one-hot), making training difficult. Dividing by dk keeps the dot products in a more reasonable range, ensuring the softmax produces well-distributed attention weights and gradients flow properly.
Q.20Medium
Which of the following statements correctly describes the difference between a Variational Autoencoder (VAE) and a standard Autoencoder?
Answer: B
In a standard autoencoder, the encoder maps an input to a single fixed latent vector, which makes the latent space potentially discontinuous and unsuitable for generation. A VAE instead encodes each input as a distribution (parameterized by a mean μ and variance σ2). During training, latent vectors are sampled from this distribution using the reparameterization trick z=μ+σ⋅ϵ, where ϵ∼N(0,I). This makes the latent space continuous and structured, enabling meaningful generation of new samples.