LinkedIn interview questions
Big tech · 5 questions reported
- junior 0
- mid 3
- senior 2
These are 5 technical questions candidates reported being asked in LinkedIn interviews for AI engineer, ML engineer and applied AI engineer roles, each with a model answer you can say out loud in a minute or two. They cover training, embeddings and ml system design: 0 junior, 3 mid-level and 2 senior questions. Every question comes from a public interview write-up that names LinkedIn.Updated
LinkedIn embeddings questions
Model answer
Join each impression to the profile as of that timestamp, label clicks positive and skips negative, then split by time: train on the past, validate on the next window, and keep anything fitted, like vocabularies or normalizers, to the training slice.
Model: a two-tower text encoder for member and item, trained contrastively with in-batch negatives plus skips as hard negatives. Evaluate recall at k against a popularity baseline.
For reproducibility, pin seeds, model versions and a data-snapshot hash in one config, ship preprocessing with the model, and test that inference reproduces the training embeddings.
LinkedIn training and optimisation questions
Model answer
import numpy as np
def sigmoid(z):
out = np.empty_like(z, dtype=float)
pos = z >= 0
out[pos] = 1 / (1 + np.exp(-z[pos]))
ez = np.exp(z[~pos])
out[~pos] = ez / (1 + ez)
return out
def train(X, y, lr=0.1, steps=1000):
# X (N, D), y (N,) of 0/1
w, b = np.zeros(X.shape[1]), 0.0
for _ in range(steps):
p = sigmoid(X @ w + b)
err = p - y # dLoss/dz for log loss
w -= lr * X.T @ err / len(y)
b -= lr * err.mean()
return w, b
The usual bugs: a sigmoid that overflows for large negative inputs; a derivative written as s(1 minus z) instead of s(1 minus s); and multiplying by that derivative again, when log loss already gives a logit gradient of exactly p minus y. Also check the sign of the update, dividing by N, and a y of shape (N, 1) silently broadcasting to (N, N). Confirm with a finite-difference gradient check.
Model answer
Sigmoid and tanh saturate, so gradients vanish; ReLU is cheap but units can die; GELU and SiLU are smooth and standard in transformers.
The loss follows the output distribution: MSE for Gaussian-ish regression, Huber against outliers, sigmoid plus binary cross-entropy, softmax plus cross-entropy.
m = b1 * m + (1 - b1) * g
v = b2 * v + (1 - b2) * g * g
m_hat = m / (1 - b1 ** t)
v_hat = v / (1 - b2 ** t)
w -= lr * m_hat / (np.sqrt(v_hat) + eps)
Adam keeps momentum and a per-parameter scale, bias-corrected. Defaults: beta1 0.9, beta2 0.999, eps 1e-8; tune the learning rate first.
Model answer
Deep trees have low bias but high variance, so averaging many helps. For B trees, each with variance σ² and pairwise correlation ρ, the average has variance ρσ² + (1 − ρ)σ²/B. More trees shrink only the second term; ρσ² is a floor.
So forests attack correlation: bootstrap samples, plus a random subset of features at each split, so one dominant feature doesn't make every tree alike. Fewer features per split lowers ρ but weakens each tree.
LinkedIn mL system design questions
Model answer
No single label works: raw watch time favours long videos, completion favours short ones. So predict several labels with a multi-task ranker: watch time normalized by duration, completion, like, share, follow, and hides or fast skips as negatives, then combine them with weights tuned against long-term retention in A/B tests.
The pipeline: two-tower retrieval over video embeddings, the ranker, then re-ranking for diversity and freshness. Model position bias separately so the ranker learns preference.
Each question comes from a public interview write-up or video that names LinkedIn; the answers are ours. Not affiliated with LinkedIn.