← LinkedIn Interview Insights

LinkedIn·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

LinkedIn data scientist technical screen, pretty deep on the ML fundamentals side. They wanted you to actually derive things, not just name-drop concepts, which I was not fully prepared for.

Questions Asked (1)

Q1

Walk through logistic regression end to end: the model formulation, the loss function, deriving the gradient of the loss with respect to weights, and how gradient descent is applied with its update rule. Be ready to write the math out.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This is where things got uncomfortable.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly stating the logistic regression model and its probabilistic interpretation, then derive the log-likelihood and gradient step-by-step. Emphasize the chain rule and matrix notation, and finish by explaining how gradient descent iteratively updates weights to minimize the loss.

Pro tip: Mention that the gradient of the log-loss has a simple form (predictions minus labels times features), which makes it efficient to compute and interpret. Also note that while gradient descent is standard, for logistic regression you can use more advanced optimizers like L-BFGS, but the underlying gradient is the same.

1. Model Formulation

Define the logistic regression model: linear combination of features passed through a sigmoid function to output probabilities. State the sigmoid function and the probabilistic interpretation for binary classification.

2. Loss Function

Introduce the negative log-likelihood (log loss) as the objective to minimize. Write it for a single example and then for the entire dataset, highlighting its convexity.

3. Gradient Derivation

Derive the gradient of the loss with respect to the weights using the chain rule. Show that the gradient simplifies to the sum over examples of (prediction - true label) times feature vector.

4. Gradient Descent Update

Explain the gradient descent algorithm: initialize weights, compute gradient, and update weights in the opposite direction of the gradient scaled by the learning rate. Write the update rule in both scalar and matrix form.

5. Convergence and Practical Considerations

Briefly discuss convergence criteria, learning rate selection, and mention that stochastic or mini-batch gradient descent can be used for large datasets.

Key Points to Mention

  • Sigmoid function and its derivative
  • Log-likelihood and negative log-likelihood (log loss)
  • Chain rule for gradient derivation
  • Gradient of log loss: (sigmoid(Xw) - y) * X
  • Gradient descent update rule: w := w - learning_rate * gradient
  • Convexity of the loss function ensuring convergence to global minimum

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