InterviewStack.io LogoInterviewStack.io

Deep Learning: Neural Networks and Architectures Questions

How deep neural networks are built and trained. Covers network fundamentals, activation functions and non-linearity, loss function selection, backpropagation, optimization and learning-rate behavior, and diagnosing vanishing or exploding gradients, along with the major architecture families: convolutional networks for images and recurrent networks, LSTMs, and GRUs for sequences. Emphasizes both how to train deep networks stably and how to match an architecture family to the structure of the data.

EasyTechnical
131 practiced

Write a PyTorch function that runs one training epoch: set the model to train mode, iterate batches, compute the loss, backpropagate, clip gradients, step the optimizer, and zero gradients. Return the average training loss.

MediumTechnical
97 practiced

You have variable-length sequences batched together with padding. Explain practical strategies for handling padding and masking during training and inference for RNNs, so you don't waste compute or leak padding into the loss.

MediumTechnical
82 practiced

Implement a numerically-stable combined softmax and cross-entropy loss (with gradient) in NumPy, given batched logits and integer labels, explaining how the log-sum-exp trick avoids overflow/underflow.

MediumTechnical
89 practiced

Discuss the trade-offs between increasing depth versus width in a neural network: representational capacity, optimization difficulty, parameter efficiency, and generalization. Give practical guidance on when to prefer deeper (with residuals) versus wider architectures under compute and latency constraints.

MediumTechnical
94 practiced

When your target metric is non-differentiable (e.g. F1 score or top-k accuracy), what practical strategies let you still train a neural network toward it? Compare surrogate losses, structured-prediction losses, and post-hoc threshold optimization, with the trade-offs of each.

Unlock Full Question Bank

Get access to all Deep Learning: Neural Networks and Architectures interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.