30 Frequently asked Deep Learning Interview Questions and Answers

Deep Learning is one of the fastest-growing fields of information technology. It is a set of techniques that permits machines to predict outputs from a layered set of inputs. Deep Learning is being embraced by companies all over the world, and anyone with software and data skills can find numerous job opportunities in this field. A career in Data Science can be the most satisfying job you ever had. However, you need to sharpen your skills in deep learning before applying for a data scientist job.

If you want to start a career in deep learning, you will come across various deep learning interviews. Worried? Don’t, here are some of the deep learning interview questions that might help you crack your next interview.

Are you preparing for an exciting career in deep learning? If yes, get the right skills with Deep Learning with Tensorflow Certification Training!

Deep Learning Interview Questions and Answers

Check out some of the frequently asked deep learning interview questions below:

1) What is Deep Learning?

Deep Learning involves taking large volumes of structured or unstructured data and using complex algorithms to train neural networks. It performs complex operations to extract hidden patterns and features (for instance, distinguishing the image of a cat from that of a dog).

What is deep learning?

2) What is a Neural Network?

Neural Networks replicate the way humans learn, inspired by how the neurons in our brains fire, only much simpler.

What is a neural network?

The most common Neural Networks consist of three network layers:

  1. An input layer
  2. A hidden layer (this is the most important layer where feature extraction takes place and adjustments are made to train faster and function better)
  3. An output layer

Each layer contains neurons called “nodes,” performing various operations. Neural Networks are used in deep learning algorithms like CNN, RNN, GAN, etc.

3) What is a Multi-Layer Perceptron(MLP)?

As in Neural Networks, MLPs have an input layer, a hidden layer, and an output layer. It has the same structure as a single layer perceptron with one or more hidden layers. A single layer perceptron can classify only linear separable classes with binary output (0,1), but MLP can classify nonlinear classes.

Except for the input layer, each node in the other layers uses a nonlinear activation function. This means the input layers, the data coming in and the activation function is based upon all nodes and weights being added together, producing the output. MLP uses a supervised learning method called “backpropagation.” In backpropagation, the neural network calculates the error with the help of cost function and propagates this error backward from where it came (adjusts the weights to train the model more accurately).

4) What is data normalization and why do we need it?

The process of standardizing and reforming data is called “Data Normalization.” It’s a pre-processing step to eliminate data redundancy. Often, data comes in and you get the same information in different formats. In these cases, you should rescale values to fit into a particular range, achieving better convergence.

5) What is the Boltzmann Machine?

One of the most basic Deep Learning models is a Boltzmann Machine, resembling a simplified version of the Multi-Layer Perceptron. This model features a visible input layer and a hidden layer -- just a two-layer neural net that makes stochastic decisions as to whether a neuron should be on or off. Nodes are connected to each other across layers but no two nodes of the same layer are connected.

6) What is the role of activation functions in a Neural Network?

At the most basic level, an activation function decides whether a neuron should be fired or not. It accepts the weighted sum of the inputs and a bias as input to any activation function. Step function, Sigmoid, ReLU, Tanh, and Softmax are examples of activation functions.

Role of activation function

7) What is the cost function?

Also referred to as “loss” or “error,” cost function is a measure to evaluate how good your model’s performance is. It’s used to compute the error of the output layer during backpropagation. We push that error backward through the neural network and use that during the different training functions.

What is the Cost function?

8) What is Gradient Descent?

Gradient Descent is an optimal algorithm to minimize the cost function or to minimize an error. The aim is to find the local global minima of a function. This determines the direction the model should take to reduce the error.

Gradient Descent

9) What do you understand by Backpropagation?

Backpropagation is a technique to improve the performance of the network. It backpropagates the error and updates the weights to reduce the error.

What do you understand by Backpropogation?

10) What is the difference between a Feedforward Neural Network and Recurrent Neural Network?

A Feedforward Neural Network signals travel in one direction from input to output. There are no feedback loops; the network considers only the current input. It cannot memorize previous inputs (e.g. CNN).

Feedforward Neural Network

A Recurrent Neural Network’s signals travel in both directions, creating a looped network. It considers the current input with the previously received inputs for generating the output of a layer and has the ability to memorize past data due to its internal memory.

Recurrent Neural Network

11) What are the applications of a Recurrent Neural Network (RNN)?

The RNN can be used for sentiment analysis, text mining and image captioning. Recurrent Neural Networks can also address time series problems such as predicting the prices of stocks in a month or quarter.

12) What are the Softmax and ReLU functions?

Softmax is an activation function that generates the output between zero and one. It divides each output, such that the total sum of the outputs is equal to one. Softmax is often used for output layers.

Softmax function

ReLU (or Rectified Linear Unit) is the most widely used activation function. It gives an output of X if X is positive and zero otherwise. ReLU is often used for hidden layers.

Relu Function

13) What are Hyperparameters?

With neural networks, you’re usually working with hyperparameters once the data is formatted properly. A hyperparameter is a parameter whose value is set before the learning process begins. It determines how a network is trained and the structure of the network (such as the number of hidden units, the learning rate, epochs, etc.).

Hyperparameters

14) What will happen if the learning rate is set too low or too high?

When your learning rate is too low, training of the model will progress very slowly as we are making very tiny updates to the weights. It will take many updates before reaching the minimum point.

If the learning rate is set too high, this causes undesirable divergent behavior to the loss function due to drastic updates in weights. It may fail to converge (model can give a good output) or even diverge (data is too chaotic for the network to train).

Learning rate is set too low or too high

15) What is Dropout and Batch Normalization?

Dropout is a technique of dropping out hidden and visible units of a network randomly to prevent overfitting of data (typically dropping 20 percent of the nodes). It doubles the number of iterations needed to converge the network.

Dropout and Batch Normalization

Batch normalization is the technique to improve the performance and stability of neural networks by normalizing the inputs in every layer so that they have mean output activation of zero and standard deviation of one.

16) What is the difference between Batch Gradient Descent and Stochastic Gradient Descent?

Batch Gradient Descent

Stochastic Gradient Descent

Batch gradient computes the gradient using the entire dataset.

It takes time to converge because the volume of data is huge and weights update slowly.

Stochastic gradient computes the gradient using a single sample.

It converges much faster than batch gradient because it updates weight more frequently.

17) What is Overfitting and Underfitting and how to combat them?

Overfitting occurs when the model learns the details and noise in the training data to the degree that it adversely impacts the execution of the model on new information. It is more likely to occur with nonlinear models that have more flexibility when learning a target function. An example would be if a model is looking at cars and trucks, but only recognizes trucks that have a certain box shape. It might not be able to notice a flatbed truck because there's only a specific kind of truck it saw in training. The model performs well on training data, but not in the real world.

Underfitting alludes to a model that is neither well-trained on data nor can generalize to new information. This usually happens when there is less and improper data to train a model. Underfitting has both poor performance and accuracy.

To combat overfitting and underfitting, you can resample the data to estimate the model accuracy (k-fold cross-validation) and by having a validation dataset to evaluate the model.

18) How are weights initialized in a network?

There are two methods here: we can either initialize the weights to zero or assign them randomly.

Initializing all weights to 0: This makes your model similar to a linear model. All the neurons and every layer perform the same operation, giving the same output and making the deep net useless.

Initializing all weights randomly: Here, the weights are assigned randomly by initializing them very close to 0. It gives better accuracy to the model since every neuron performs different computations. This is the most commonly used method.

19) What are the different layers in CNN?

There are four layers in CNN:

  1. Convolutional Layer -  the layer that performs a convolutional operation, creating a number of smaller picture windows to go over the data.
  2. ReLU Layer - it brings non-linearity to the network and converts all the negative pixels to zero. The output is a rectified feature map.
  3. Pooling Layer - pooling is a down-sampling operation that reduces the dimensionality of the feature map.
  4. Fully Connected Layer - this layer recognizes and classifies the objects in the image.
Master the deep learning concepts and TensorFlow open-source framework with the Deep Learning Course! Check out the Course Preview today!

20) What is Pooling in CNN and how does it work?

Pooling is used to reduce the spatial dimensions of a CNN. It performs down-sampling operations to reduce the dimensionality and creates a pooled feature map by sliding a filter matrix over the input matrix.

Pooling in CNN

21) How does an LSTM network work?

Long-Short-Term Memory (LSTM) is a special kind of recurrent neural network capable of learning long-term dependencies, remembering information for long periods of time as its default behavior. There are three steps in an LSTM network:

  • Step 1: The network decides what to forget and what to remember.
  • Step 2: It selectively updates cell state values.
  • Step 3: The network decides what part of the current state makes it to the output.

Working of LSTM network

22) What are Vanishing and Exploding Gradients?

While training an RNN, your slope can become either too small or too large; this makes the training difficult. When the slope is too small, the problem is known as a “Vanishing Gradient.” When the slope tends to grow exponentially instead of decaying, it’s referred to as an “Exploding Gradient.” Gradient problems lead to long training times, poor performance and low accuracy.

Vanishing and Exploding Gradients

23) What is the difference between Epoch, Batch and Iteration in Deep Learning?

  • Epoch - Represents one iteration over the entire dataset (everything put into the training model).
  • Batch - Refers to when we cannot pass the entire dataset into the neural network at once, so we divide the dataset into a number of batches.
  • Iteration - if we have 10,000 images as data and a batch size of 200. then an epoch should run 50 iterations (10,000 divided by 50).

24) Why is TensorFlow the most preferred library in Deep Learning?

Tensorflow provides both C++ and Python APIs, making it easier to work on and has a faster compilation time compared to other Deep Learning libraries like Keras and Torch. Tensorflow supports both CPU and GPU computing devices.

25) What do you mean by Tensor in TensorFlow?

A tensor is a mathematical object represented as arrays of higher dimensions. These arrays of data with different dimensions and ranks fed as input to the neural network are called “Tensors.”

What do you mean by Tensor in Tensorflow?

26) What are the programming elements in TensorFlow?

Constants - Constants are parameters whose value does not change. To define a constant we use  tf.constant() command. For example:

a = tf.constant(2.0,tf.float32)

b = tf.constant(3.0)

Print(a, b)

Variables - Variables allow us to add new trainable parameters to graph. To define a variable, we use the tf.Variable() command and initialize them before running the graph in a session. An example:

W = tf.Variable([.3].dtype=tf.float32)

b = tf.Variable([-.3].dtype=tf.float32)

Placeholders - these allow us to feed data to a tensorflow model from outside a model. It permits a value to be assigned later. To define a placeholder, we use the tf.placeholder() command. An example:

a = tf.placeholder (tf.float32)

b = a*2

with tf.Session() as sess:

result = sess.run(b,feed_dict={a:3.0})

print result

Sessions - a session is run to evaluate the nodes. This is called the “Tensorflow runtime.” For example:

a = tf.constant(2.0)

b = tf.constant(4.0)

c = a+b

# Launch Session

Sess = tf.Session()

# Evaluate the tensor c

print(sess.run(c))

27) Explain a Computational Graph.

Everything in a tensorflow is based on creating a computational graph. It has a network of nodes where each node performs an operation, Nodes represent mathematical operations and edges represent tensors. Since data flows in the form of a graph, it is also called a “DataFlow Graph.”

28) Explain Generative Adversarial Network.

Suppose there is a wine shop purchasing wine from dealers which they resell later. But there are some dealers who sell fake wine. In this case, the shop owner should be able to distinguish between fake and authentic wine.

The forger will try different techniques to sell fake wine and make sure certain techniques go past the shop owner’s check. The shop owner would probably get some feedback from wine experts that some of the wine is not original. The owner would have to improve how he determines whether a wine is fake or authentic.

The forger’s goal is to create wines that are indistinguishable from the authentic ones while the goal of the shop owner is to accurately tell if the wine is real or not.

Main components of Generator and Discriminator

Let us understand this example with the help of an image shown above.

There is a noise vector coming into the forger who is generating fake wine.

Here the forger acts as a Generator.

The shop owner acts as a Discriminator.

The Discriminator gets two inputs, one is the fake wine while other is the real authentic wine. The shop owner has to figure out whether it is real or fake.

So, there are two main components of Generative Adversarial Network (GAN) named:

  1. Generator
  2. Discriminator

The generator is a CNN that keeps keys producing images and are closer in appearance to the real images while the discriminator tries to determine the difference between real and fake images The ultimate aim is to make the discriminator learn to identify real and fake images.

29) What is an auto-encoder?

What is an auto encoder?

This Neural Network has three layers in which the input neurons are equal to the output neurons. The network's target outside is the same as the input. It uses dimensionality reduction to restructure the input. It works by compressing the image input to a latent space representation then reconstructing the output from this representation.

30) What is Bagging and Boosting?

Bagging and Boosting are ensemble techniques to train multiple models using the same learning algorithm and then taking a call.

What is Bagging?

With Bagging, we take a dataset and split it into training data and test data. Then we randomly select data to place into the bags and train the model separately.

What is boosting?

With Boosting, the emphasis is on selecting data points which give wrong output in order to improve the accuracy.

Here is the video explanation of the Deep Learning Interview Questions: 

Conclusion

So we have covered a number of deep learning interview questions that will help you land the perfect job that you always desired. Do you feel unprepared regarding the concepts covered in these interview questions? Then Simplilearn is here to help you upskill yourself. We offer Deep Learning with TensorFlow Certification course that will assist you in gaining expertise in all the concepts of Deep Learning.  

About the Author

Shivam AroraShivam Arora

Shivam Arora is a Senior Product Manager at Simplilearn. Passionate about driving product growth, Shivam has managed key AI and IOT based products across different business functions. He has 6+ years of product experience with a Masters in Marketing and Business Analytics.

View More
  • Disclaimer
  • PMP, PMI, PMBOK, CAPM, PgMP, PfMP, ACP, PBA, RMP, SP, and OPM3 are registered marks of the Project Management Institute, Inc.