← LinkedIn Interview Insights

LinkedIn·Data Scientist·Technical Phone Screen·Senior

Senior
May 2026

Summary

LinkedIn data scientist interview that went deep into the math. They wanted a full derivation of backpropagation on the whiteboard, not just a conceptual walkthrough, which I was not fully prepared for.

Questions Asked (1)

Q1

Derive backpropagation from scratch for a feed-forward neural network. Walk through the forward pass equations for each layer (linear transformation plus activation), define the loss function, apply the chain rule to get the gradients of the loss with respect to weights and biases at each layer, and write out the parameter update rule. Math notation required, not just verbal explanation.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

I knew backprop conceptually but writing out the actual partial derivatives layer by layer under pressure is a different thing.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the network architecture and notation, then systematically derive the forward pass, loss, backward pass using the chain rule, and parameter updates. Use matrix calculus to keep the derivation concise and general for any layer.

Pro tip: Emphasize the modularity of backpropagation: the same gradient computation applies to any layer, and vectorizing across layers and batches is key for efficiency. Mention that this derivation is the foundation for frameworks like PyTorch and TensorFlow.

1. Define Network Architecture and Notation

Specify an L-layer feed-forward network with layer sizes, activation functions, and notation for weights, biases, pre-activations, and activations.

2. Forward Pass Equations

Write the linear transformation and activation for each layer: z^(l) = W^(l) a^(l-1) + b^(l), a^(l) = f^(l)(z^(l)).

3. Define Loss Function

Choose a loss function (e.g., cross-entropy for classification or MSE for regression) and express it in terms of the final layer output.

4. Backward Pass: Compute Gradients

Apply the chain rule to derive the error term δ^(l) for each layer, then compute gradients w.r.t. weights and biases: ∂L/∂W^(l) = δ^(l) (a^(l-1))^T, ∂L/∂b^(l) = δ^(l).

5. Parameter Update Rule

State the gradient descent update: W^(l) ← W^(l) - η ∂L/∂W^(l), b^(l) ← b^(l) - η ∂L/∂b^(l), and mention extensions like SGD with momentum or Adam.

Key Points to Mention

  • Chain rule application: δ^(l) = (W^(l+1))^T δ^(l+1) ⊙ f'^(l)(z^(l))
  • Vectorization: gradients computed for a batch of samples using matrix operations
  • Activation function derivatives: e.g., sigmoid, tanh, ReLU
  • Loss function choice and its derivative w.r.t. output
  • Computational graph and modularity: backprop as reverse-mode autodiff
  • Parameter update: gradient descent and variants (SGD, Adam)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.