← LinkedIn Interview Insights

LinkedIn·Data Scientist·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

LinkedIn data scientist technical screen, pretty much a full logistic regression deep dive from model formulation all the way through gradient descent. They wanted math on the whiteboard, not just conceptual hand-waving, which I was not entirely prepared for.

Questions Asked (1)

Q1

Walk through logistic regression end to end: how the model is formulated using a sigmoid applied to a linear combination of inputs, what loss function is used and why, derive the gradient of that loss with respect to the weights, and explain how gradient descent applies including the update rule and learning rate. Be prepared to write the math out explicitly.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

This is one question but it's really like four questions stapled together.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Structure your answer as a clear, step-by-step derivation: start with the model formulation, then introduce the loss function with justification, derive the gradient, and finally explain gradient descent with the update rule. Write the math explicitly on the whiteboard, narrating each step to show your reasoning.

Pro tip: Emphasize the probabilistic interpretation of the sigmoid and the maximum likelihood derivation of the loss, as this demonstrates deep understanding beyond rote memorization. Also, mention practical considerations like feature scaling and learning rate selection to show real-world awareness.

1. Model Formulation

Define the linear combination z = w^T x + b, then apply the sigmoid function σ(z) = 1/(1+e^{-z}) to get the predicted probability p(y=1|x). Explain that the sigmoid maps real values to (0,1), making it suitable for binary classification.

2. Loss Function

Introduce the binary cross-entropy loss (log loss): L(w) = -[y log(p) + (1-y) log(1-p)]. Justify it via maximum likelihood estimation, showing that minimizing this loss is equivalent to maximizing the likelihood of the observed data.

3. Gradient Derivation

Derive the gradient of the loss with respect to weights: ∇_w L = (p - y) x. Show the steps using the chain rule, highlighting that the sigmoid derivative simplifies the expression elegantly.

4. Gradient Descent and Update Rule

Explain gradient descent: iteratively update weights in the opposite direction of the gradient: w := w - α ∇_w L, where α is the learning rate. Discuss the role of the learning rate and potential issues like slow convergence or divergence.

5. Practical Considerations

Mention extensions like regularization (L1/L2), stochastic gradient descent, and convergence checks. Briefly note how to handle the bias term and the importance of feature scaling for gradient descent.

Key Points to Mention

  • Sigmoid function and its probabilistic interpretation
  • Binary cross-entropy loss derived from maximum likelihood
  • Gradient derivation using chain rule: ∇_w L = (p - y) x
  • Gradient descent update rule: w := w - α ∇_w L
  • Role of learning rate and its impact on convergence
  • Regularization and practical tips like feature scaling

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