Neural Networks Questions with Answers

12 practice questions on Neural Networks (Machine Learning) with answers and step-by-step solutions. Try 10 samples below, then practise all 12 free in the AptiNest app.

Sample questions

Question 1Easy

Which layer type is typically used to detect local patterns such as edges in images?

  1. Dropout layer
  2. Convolutional layer
  3. Embedding layer
  4. Softmax layer

Answer: B. Convolutional layer

Explanation

Convolutional layers slide small shared filters over the image, picking up local features like edges and textures.

Step-by-step solution

  1. Filters slide across the image.
  2. Each filter responds to a local pattern.
  3. Stacked layers build complex features.

Why the other options are wrong

  • A. Dropout is a regulariser, it does not detect patterns.
  • C. Embedding maps discrete tokens to vectors, mostly for text.
  • D. Softmax converts scores to probabilities at the output.

Question 2Easy

One full pass of the entire training dataset through the network is called a(n)

  1. Batch
  2. Iteration
  3. Epoch
  4. Layer

Answer: C. Epoch

Explanation

An epoch is one complete pass over all training examples, made of many batch iterations.

Step-by-step solution

  1. Split data into batches.
  2. Each batch gives one iteration.
  3. All batches done = one epoch.

Why the other options are wrong

  • A. A batch is a subset of the data used for one update.
  • B. An iteration is one update step on one batch.
  • D. A layer is part of the architecture, not a training pass.

Question 3Easy

In a neural network, what does backpropagation compute?

  1. The final prediction of the model
  2. The best number of hidden layers and neurons for the task
  3. Gradients of the loss with respect to the weights
  4. The training set labels

Answer: C. Gradients of the loss with respect to the weights

Explanation

Backpropagation applies the chain rule backwards through the layers to get dLoss/dWeight, which gradient descent then uses.

Step-by-step solution

  1. Forward pass gives prediction and loss.
  2. Chain rule moves the error backwards.
  3. Gradients update the weights.

Why the other options are wrong

  • A. That is the forward pass.
  • B. Architecture is chosen by the designer or tuning, not by backprop.
  • D. Labels are given data; backprop does not produce them.

Question 4Easy

What is the main purpose of a non-linear activation function between layers of a neural network?

  1. It speeds up matrix multiplication
  2. It lets the network learn non-linear relationships
  3. It reduces the number of weights
  4. It normalises the input data so every feature has a similar scale

Answer: B. It lets the network learn non-linear relationships

Explanation

Without non-linearity, stacked linear layers collapse into one linear map, so depth adds no power.

Step-by-step solution

  1. Linear layer: y = Wx + b.
  2. Two linear layers compose into another linear map.
  3. A non-linearity breaks this collapse.

Why the other options are wrong

  • A. Activations add compute; they do not speed up matrix multiplication.
  • C. Weight count depends on layer sizes, not on activations.
  • D. Input normalisation is a preprocessing step, not the role of an activation.

Question 5Medium

What does dropout do during training?

  1. Removes the lowest-weight neurons permanently after training ends
  2. Drops the examples with the highest loss
  3. Randomly sets a fraction of neuron outputs to zero to reduce overfitting
  4. Reduces the learning rate over time

Answer: C. Randomly sets a fraction of neuron outputs to zero to reduce overfitting

Explanation

Dropout stops neurons from co-adapting by zeroing random units each step; at inference all units are used.

Step-by-step solution

  1. Pick a random mask each training step.
  2. Zero the masked activations.
  3. At test time use the full network.

Why the other options are wrong

  • A. Dropout is random and temporary per step, not permanent pruning.
  • B. That is a data-selection idea, not dropout.
  • D. That is a learning-rate schedule, not dropout.

Question 6Medium

Why is the softmax function used in the output layer of a multi-class classifier?

  1. It turns raw scores into probabilities that sum to 1
  2. It makes every class equally likely
  3. It removes negative scores by setting them to 0 and keeping the rest unchanged
  4. It picks the class index directly

Answer: A. It turns raw scores into probabilities that sum to 1

Explanation

Softmax exponentiates scores and divides by their sum, giving a valid probability distribution over classes.

Step-by-step solution

  1. Exponentiate each score.
  2. Divide by the total.
  3. Result is positive and sums to 1.

Why the other options are wrong

  • B. Softmax keeps relative differences; it does not equalise scores.
  • C. That describes ReLU; softmax uses exponentials.
  • D. Argmax picks the class; softmax outputs a probability vector.

Question 7Medium

A dataset has 1000 samples and the batch size is 50. How many weight updates happen in 3 epochs with standard mini-batch training?

  1. 20
  2. 150
  3. 3000
  4. 60

Answer: D. 60

Explanation

Each epoch has 1000/50 = 20 updates, so 3 epochs give 60.

Step-by-step solution

  1. Updates per epoch = 1000/50 = 20.
  2. Epochs = 3.
  3. Total = 20 x 3 = 60.

Why the other options are wrong

  • A. This is one epoch's worth only (1000/50).
  • B. Multiplies 50 by 3 and ignores the dataset size.
  • C. Multiplies 1000 by 3 as if one update per sample.

Question 8Medium

A fully connected layer maps 100 inputs to 50 outputs with a bias per output neuron. How many trainable parameters does it have?

  1. 5000
  2. 150
  3. 5100
  4. 5050

Answer: D. 5050

Explanation

Weights = 100 x 50 = 5000, plus 50 biases = 5050.

Step-by-step solution

  1. Weights: 100 x 50 = 5000.
  2. Biases: one per output = 50.
  3. Total = 5050.

Why the other options are wrong

  • A. Forgets the 50 bias terms.
  • B. Adds the sizes instead of multiplying for weights.
  • C. Adds 100 biases instead of one per output neuron (50).

Tip: Params = inputs x outputs + outputs.

Question 9Hard

A network has layers 4 -> 8 -> 3 (fully connected, bias in every neuron of hidden and output layers). Total trainable parameters?

  1. 56
  2. 59
  3. 64
  4. 67

Answer: D. 67

Explanation

Layer 1: 4x8+8 = 40. Layer 2: 8x3+3 = 27. Total 67.

Step-by-step solution

  1. Layer 1: 4*8 = 32 weights + 8 biases = 40.
  2. Layer 2: 8*3 = 24 weights + 3 biases = 27.
  3. 40 + 27 = 67.

Why the other options are wrong

  • A. Counts only weights (32 + 24) and skips biases.
  • B. Adds only the 3 output biases and skips the 8 hidden biases.
  • C. Drops the 3 output biases.

Question 10Hard

A single neuron has weights w=(2, -1), bias b=0.5, sigmoid activation, and input x=(1, 3). Which is closest to its output?

  1. 0.38
  2. 0.82
  3. 0.62
  4. 0.5

Answer: A. 0.38

Explanation

z = 2*1 + (-1)*3 + 0.5 = -0.5. sigmoid(-0.5) = 1/(1+e^0.5) = 0.378.

Step-by-step solution

  1. z = 2*1 - 1*3 + 0.5 = -0.5.
  2. sigmoid(-0.5) = 1/(1+e^0.5).
  3. = 0.378, about 0.38.

Why the other options are wrong

  • B. That is sigmoid(1.5), which comes from a sign error in the weighted sum.
  • C. That is sigmoid(0.5), which is the bias alone and ignores the inputs.
  • D. That would need a weighted sum of exactly 0.

Practise all 12 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all Machine Learning topics · All topics