← LinkedIn Interview Insights

LinkedIn·Machine Learning Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

LinkedIn ML Engineer screen, one meaty theory question on logistic regression loss functions. Pretty standard for this type of role but it went deeper than I expected.

Questions Asked (1)

Q1

What loss function does logistic regression typically use, and what's the reasoning behind that choice?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

Knew binary cross-entropy was the answer but fumbled explaining the 'why' at first.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by directly answering that logistic regression typically uses the log loss (binary cross-entropy). Then explain the reasoning: it's derived from maximum likelihood estimation under a Bernoulli distribution, and it provides a convex loss surface that is efficient to optimize. Finally, briefly contrast it with alternatives like MSE to highlight why log loss is preferred.

Pro tip: Mention that log loss heavily penalizes confident misclassifications, which is crucial for probabilistic models, and note that using MSE would lead to a non-convex loss for logistic regression, making optimization harder.

1. State the loss function

Clearly identify that logistic regression uses the log loss (binary cross-entropy) for binary classification, and categorical cross-entropy for multiclass.

2. Explain the probabilistic foundation

Describe how the loss is derived from maximum likelihood estimation, assuming the target follows a Bernoulli distribution (or categorical for multiclass).

3. Highlight optimization benefits

Emphasize that log loss is convex for logistic regression, ensuring that gradient-based methods converge to the global minimum.

4. Contrast with alternatives

Briefly compare with mean squared error (MSE), noting that MSE is non-convex for logistic regression and less suitable for probabilistic outputs.

5. Connect to practical implications

Mention that log loss penalizes confident wrong predictions heavily, which aligns with the goal of well-calibrated probabilities.

Key Points to Mention

  • Log loss (binary cross-entropy) formula: -[y log(p) + (1-y) log(1-p)]
  • Derivation from maximum likelihood estimation under Bernoulli distribution
  • Convexity of log loss for logistic regression, ensuring global optimum
  • Non-convexity of MSE when used with sigmoid, leading to poor local minima
  • Heavy penalty for confident misclassifications, promoting calibrated probabilities
  • Extension to multiclass via categorical cross-entropy (softmax loss)

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