CNN, RNN and NLP Interview Questions

Deep Learning with Keras and TensorFlow 12 min min read Updated: Nov 16, 2026 Advanced
CNN, RNN and NLP Interview Questions
Advanced Topic 3 of 3

CNN, RNN and NLP Interview Questions

1. Why are CNNs better than dense networks for images?

CNNs use small filters shared across the image, so they have far fewer parameters, they detect local patterns such as edges and they are tolerant to the position of objects.

2. What do the convolution, stride and padding do?

Convolution slides a filter over the input to produce a feature map. Stride is the step size of the filter. Padding adds borders (zeros) to control the output size, with same padding keeping the size.

3. What is pooling and why use it?

Pooling reduces the size of feature maps, for example with max pooling over 2 x 2 windows. It lowers computation and gives some translation invariance.

4. How do you calculate the output size of a convolution?

Output = (input - kernel + 2 x padding) / stride + 1. For a 28 x 28 input, a 3 x 3 filter, no padding and stride 1, the output is 26 x 26.

5. What is GlobalAveragePooling and why is it used instead of Flatten?

It averages each feature map to one value. It gives far fewer parameters than Flatten followed by a big Dense layer, which reduces overfitting.

6. What is data augmentation?

Creating modified copies of training data, such as flips, rotations and zooms, to increase variety and reduce overfitting.

7. What is a residual connection?

A shortcut that adds the input of a block to its output. It helps gradients flow in very deep networks, as in ResNet.

8. What is transfer learning versus fine-tuning?

Transfer learning reuses a pretrained model, usually with frozen layers and a new head. Fine-tuning additionally unfreezes some layers and trains them with a small learning rate.

9. Why can't a plain dense network handle sequences well?

It takes fixed-size input and has no memory of order. RNNs process one step at a time and share weights across time, so they handle variable lengths and keep a hidden state.

10. What problem do LSTM and GRU solve?

The vanishing gradient problem of simple RNNs. Gates control what to remember and forget, so they can keep information over long sequences. GRU is simpler and faster, LSTM is more expressive.

11. What is a bidirectional RNN?

It processes the sequence in both directions and combines the results, so each position knows both the past and the future context.

12. What is a word embedding?

A dense vector that represents a word. Similar words have similar vectors. It is more compact and meaningful than one-hot encoding.

13. Explain attention in simple words.

For each position, attention computes how relevant every other position is, using queries, keys and values, then produces a weighted sum of the values. It lets the model focus on the important parts of the input.

14. Why did Transformers replace RNNs in most NLP tasks?

They process all positions in parallel, which trains faster on GPUs, and self-attention connects distant words directly, which handles long-range dependencies better.

15. Why do Transformers need positional encoding?

Self-attention has no sense of order by itself. Positional embeddings add information about the position of each token.

16. What is an autoencoder and what is it used for?

A network that compresses data through a bottleneck and reconstructs it. Used for dimensionality reduction, denoising and anomaly detection.

17. How does a GAN work?

A generator creates fake samples and a discriminator tries to tell real from fake. They train against each other until the fakes look real.

Interview tip: Draw small diagrams while you explain. A sketch of a CNN pipeline or an LSTM cell makes your answer clearer and shows real understanding.

Conclusion

Understanding why each architecture exists is more valuable than memorizing definitions. Link every answer to a problem it solves.

Quick Summary: CNN for images, RNN, LSTM and GRU for sequences, attention and Transformers for long-range context, and know their trade-offs.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators