← All Posts
Machine Learning · Regression · Interview Series · Focused Series Overview

Regression Types for Interviews

Regression is a family of models, not only ordinary least squares. Model choice starts with the quantity being estimated and the kind of outcome being observed. A real-valued amount, binary event, count, positive duration, and partly observed event time need different assumptions.

The exact target is called the estimand. It might be a conditional mean, a median, another quantile, an event rate, or a survival probability. The possible values of the outcome are its support. Naming these two items prevents many model-choice mistakes.

For models of a conditional mean, a common template is

$$g\big(E[Y\mid X]\big)=\eta(X).$$

The link $g$ connects the mean to a predictor $\eta(X)$. A polynomial or spline changes the shape of $\eta$. A generalized linear model can change the outcome distribution and link. WLS and GLS change how errors are weighted or correlated. Quantile and survival models use different targets, so they do not fit this mean template directly.

Five Parts of a Regression Choice

ChoicePlain-language questionExamples
Outcome and targetWhat can the outcome be, and which part of it matters?Mean amount, binary probability, count rate, quantile, survival probability
Relationship shapeIs the relationship straight, curved, grouped, or interactive?Linear terms, interactions, polynomials, splines, additive smooths
Fitting ruleWhat rule chooses the coefficients?Least squares, weighted least squares, likelihood, quantile loss, posterior updating
Error patternDo errors have unequal spread or depend on one another?Constant variance, inverse-variance weights, GLS, cluster-robust covariance
Complexity controlHow are unstable or overly flexible estimates restrained?Ridge, lasso, smoothing penalties, Gaussian and hierarchical priors

These choices are separate. The quadratic model $\beta_0+\beta_1x+\beta_2x^2$ changes the relationship shape, but it is still linear in the coefficients. OLS can estimate those coefficients. Polynomial regression is therefore not an alternative fitting rule to OLS; it is a different set of columns for OLS to fit.

Which Part of the Model Must Change?

Each state shows evidence for a different change: relationship shape, error pattern, outcome family, pooling, representation, or censoring-aware likelihood.

A Selection Framework for Interview Cases

Observed clueLikely starting pointMain condition to check
A continuous outcome follows a smooth curvePolynomial basis, spline, or GAMHeld-out error improves without unstable extrapolation
Residual spread changes or nearby rows share errorsWLS or GLSThe proposed weights or dependence pattern are credible
The outcome is binary, a count, or strictly positiveGLMThe family, link, and mean-variance relationship fit the outcome
Related groups have little data individuallyHierarchical Bayesian regressionPartial pooling across groups is scientifically reasonable
Many predictors carry overlapping informationPCR or PLSComponent count is chosen inside validation
Some event times are not fully observedCox, parametric survival, or AFTThe censoring and model-specific time assumptions are credible

A Complete Answer Structure

A clear model recommendation covers six parts:

  1. Target: the mean, quantile, event rate, hazard, survival probability, or full predictive distribution.
  2. Outcome values: real-valued, binary, count, positive, ordinal, or censored.
  3. Relationship: straight, curved, additive, interactive, grouped, or low-dimensional.
  4. Fitting method: least squares, weighted least squares, likelihood, partial likelihood, or posterior computation.
  5. Assumptions: independent errors, correct family, credible covariance, non-informative censoring, or exchangeable groups.
  6. Validation: split design, tuning boundaries, diagnostics, uncertainty, and deployment range.
One change does not repair every layer. A flexible curve does not fix dependent errors, leakage, biased censoring, or unsupported extrapolation. Each problem needs a matching remedy.

Interview Priority Map

PriorityExpected coverage
Must knowSimple and multiple OLS, assumptions, logistic regression, regularization, residual diagnostics, feature leakage, and train-validation-test separation
Common extensionsPolynomial terms, interactions, WLS, count GLMs, splines, robust and quantile losses, and cross-validated tuning
SpecializedGLS covariance models, Bayesian hierarchy, PCR and PLS, zero-inflated counts, GAM interactions, and censored survival likelihoods

Recurring Interview Traps

Focused Series Roadmap

Splines and GAMs

Local bases, knots, natural constraints, smoothing penalties, effective degrees of freedom, and additive effects.

Bayesian Regression

Prior-likelihood updating, conjugacy, shrinkage, hierarchical pooling, posterior prediction, and diagnostics.

PCR and PLS

SVD scores, supervised latent components, standardization, component selection, interpretation, and leakage.

The linear regression foundation explains conditional and partial effects. The OLS projection chapter supplies the geometry behind basis regression, WLS, PCR, and smoothers. Separate chapters cover coefficient penalties and alternative losses and targets.

The logistic regression series provides the binary-outcome and IRLS foundation. Implementation companions begin at C++ Regression from Scratch.