← LinkedIn Interview Insights

LinkedIn·Data Scientist·Technical Phone Screen·Senior

Senior
Jun 2026

Summary

LinkedIn data scientist interview that went deep into the math. One question, no fluff, they wanted you to actually write out the backprop derivation on the spot, not just talk about it in vague terms.

Questions Asked (1)

Q1

Derive backpropagation from scratch for a feed-forward neural network. Walk through the forward pass equations (linear transformation plus activation at each layer), define the loss, then use the chain rule to derive the weight and bias gradients for each layer. Write out the actual math.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This is the kind of question where nodding along in study sessions does not prepare you.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly defining the network architecture and notation, then systematically derive the forward pass, loss, and backward pass using the chain rule. Write out the equations layer by layer, emphasizing the recursive nature of backpropagation and the role of activation derivatives.

Pro tip: When deriving, explicitly state the dimensions of each matrix and vector to demonstrate rigor and catch shape mismatches—this shows practical implementation awareness that interviewers value.

1. Define notation and architecture

Specify the network with L layers, layer sizes, weight matrices W^l, bias vectors b^l, and activation functions σ^l. Use clear index notation for samples and layers.

2. Write forward pass equations

For each layer l, write z^l = W^l a^{l-1} + b^l and a^l = σ^l(z^l), with a^0 = x. Define the final output and loss function (e.g., MSE or cross-entropy).

3. Derive gradients via chain rule

Define the error term δ^l = ∂L/∂z^l. Derive the recursive relation δ^l = (W^{l+1}^T δ^{l+1}) ⊙ σ'^l(z^l) for hidden layers, and the output layer δ^L = ∇_a L ⊙ σ'^L(z^L).

4. Compute weight and bias gradients

Using δ^l, write ∂L/∂W^l = δ^l (a^{l-1})^T and ∂L/∂b^l = δ^l. Show that these follow from the chain rule applied to z^l = W^l a^{l-1} + b^l.

5. Summarize and discuss implementation

Present the full backpropagation algorithm: forward pass to cache activations, backward pass to compute δ and gradients, then update parameters. Mention vectorization and computational cost.

Key Points to Mention

  • Chain rule application through composed functions
  • Definition and recursive computation of the error term δ^l
  • Element-wise multiplication with activation derivative (Hadamard product)
  • Gradient formulas: ∂L/∂W^l = δ^l (a^{l-1})^T and ∂L/∂b^l = δ^l
  • Importance of caching forward activations for efficiency
  • Vectorized implementation over mini-batches

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