← Pinterest Interview Insights

Pinterest·Machine Learning Engineer·Online Assessment (OA)·Intermediate

Intermediate
Jun 2026

Summary

Pinterest ML engineer interview had a multiple-choice section where you actually had to do neural network forward pass math by hand. Nothing crazy, but it caught me a little off guard that they expected you to crunch numbers rather than just talk through concepts.

Questions Asked (1)

Q1

Given small weight matrices and a bias vector, manually compute the output of a fully-connected layer followed by one or two activation functions (e.g. ReLU, sigmoid, softmax) applied end-to-end.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

The arithmetic is kept simple on purpose, which almost made me second-guess myself.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, restate the layer computation as z = Wx + b (or z = xW + b depending on convention) and compute each pre-activation value carefully. Then apply the activation functions in sequence, showing intermediate results and keeping track of dimensions and numerical stability, especially for softmax.

Pro tip: Before computing, explicitly state your convention for matrix orientation (e.g., row vectors vs. column vectors) and whether the bias is added per output neuron; this prevents off-by-one errors and shows you think like a production ML engineer.

1. Clarify dimensions and conventions

Confirm the shapes of the weight matrix, input vector, and bias, and state whether you treat inputs as row or column vectors. This ensures the matrix multiplication is set up correctly.

2. Compute pre-activation values

Perform the matrix-vector multiplication and add the bias to get the linear output z for each neuron. Show the arithmetic clearly, one neuron at a time.

3. Apply the first activation function

Apply the specified activation (e.g., ReLU or sigmoid) element-wise to z, producing the first hidden layer output. Note any piecewise behavior (e.g., ReLU zeroing negatives).

4. Apply the second activation if required

If a second activation (e.g., softmax) is specified, apply it to the output of the first activation. For softmax, compute exponentials and normalize by their sum.

5. Verify and interpret the result

Check that the final output has the expected shape and properties (e.g., probabilities sum to 1 for softmax). Briefly interpret what the output represents in the context of the network.

Key Points to Mention

  • Matrix multiplication order and dimension compatibility (e.g., (1×d) · (d×h) = (1×h)).
  • Bias addition is per output neuron and broadcasts across the batch dimension.
  • ReLU: max(0, z) — discuss dead neurons and sparsity.
  • Sigmoid: 1/(1+e^{-z}) — mention saturation and output range (0,1).
  • Softmax: exp(z_i)/sum(exp(z_j)) — emphasize numerical stability (subtract max) and probability interpretation.
  • Activation functions introduce non-linearity, enabling the network to learn complex patterns.

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