InterviewStack.io LogoInterviewStack.io

Neural Network Architectures Questions

Broad coverage of modern and advanced neural network architectures, design principles, and components. Candidates should understand core structural elements such as neurons, layers, weights, biases, activation functions, forward and backward passes, and how architecture choices influence learning. Know a range of architecture families including feedforward networks, convolutional neural networks, recurrent neural networks including long short term memory and gated recurrent unit variants, transformer architectures with self attention and multi head attention, vision transformer adaptations, and graph neural networks. Understand inductive biases that make certain architectures appropriate for particular data modalities, trade offs between depth and width, parameter efficiency and computational complexity, and practical considerations such as initialization, normalization, optimization, and scaling strategies. Be able to explain when to choose one architecture over another for a given problem, how to combine or adapt architectures for domain specific needs, and how modern architecture advances address limitations of prior models.

EasyTechnical
80 practiced
Implement a 2D convolution forward operation in Python using NumPy for a single-channel image. Function signature: conv2d(input, kernel, stride=1, padding=0). Input shape: (H_in, W_in). Kernel: (K_h, K_w). Return the output 2D array. Do not use any library convolution helpers. Include handling of padding and stride semantics.
EasyTechnical
95 practiced
Implement a forward pass for a two-layer feedforward neural network in Python using NumPy. Input X has shape (batch_size, input_dim). Given weight matrices W1 (input_dim, hidden_dim), b1 (hidden_dim,), W2 (hidden_dim, output_dim), b2 (output_dim,), compute hidden = ReLU(X @ W1 + b1), logits = hidden @ W2 + b2, probs = softmax(logits). Return (logits, probs). Do not use TensorFlow/PyTorch. Include a short docstring and simple shape checks.
MediumTechnical
122 practiced
Explain scaled dot-product attention and multi-head attention algorithmically and mathematically. Provide the equations for Attention(Q,K,V), explain the sqrt(d_k) scaling factor, compute time and memory complexity in terms of sequence length L and embedding dim d, and discuss why multiple heads can be beneficial.
HardTechnical
76 practiced
Provide PyTorch code (skeleton) that executes a custom optimizer step with global gradient-norm clipping, learning-rate scaling for gradient-accumulation steps, and support for mixed-precision training using torch.cuda.amp. Include comments indicating where to call clip and scaler operations and how to handle zero_grad and optimizer.step safely.
MediumTechnical
77 practiced
You have only 1,000 labeled medical images to build a cancer detection model. Describe a step-by-step transfer learning approach using a pre-trained CNN (e.g., ResNet): data preprocessing, augmentation, layer freezing/unfreezing schedule, optimizer and learning rates, regularization, cross-validation, and evaluation procedures to avoid overfitting.

Unlock Full Question Bank

Get access to hundreds of Neural Network Architectures interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.