InterviewStack.io LogoInterviewStack.io

Linear and Logistic Regression Implementation Questions

Covers the fundamentals and implementation details of linear regression for continuous prediction and logistic regression for binary or multiclass classification. Candidates should understand model formulation, hypothesis functions, and the intuition behind fitting a line or hyperplane for regression and using a sigmoid or softmax function for classification. Include loss functions such as mean squared error for regression and cross entropy loss for classification, optimization methods including gradient descent and variants, regularization techniques, feature engineering and scaling, metrics for evaluation such as mean absolute error and accuracy and area under curve, and hyperparameter selection and validation strategies. Expect discussion of practical implementation using numerical libraries and machine learning toolkits, trade offs and limitations of each approach, numerical stability, and common pitfalls such as underfitting and overfitting.

HardTechnical
49 practiced
A logistic regression model for 90-day customer retention shows degrading performance due to temporal drift. Propose step-by-step remediation covering data partitioning for time-aware validation, feature engineering (lags, rolling statistics, exponential decay), retraining frequency, and how to evaluate whether retraining improved production performance.
MediumTechnical
54 practiced
Explain numerical issues when computing softmax and cross-entropy for multiclass logistic regression. Implement a numerically stable softmax function and show how to compute log-softmax and cross-entropy loss with the log-sum-exp trick in Python/NumPy to avoid overflow and loss of precision.
MediumTechnical
47 practiced
Describe residual analysis for a fitted linear regression model: how to use residual vs fitted plots, QQ-plots, Cook's distance, and leverage to detect non-linearity, non-normality, heteroscedasticity, and influential observations. Recommend remediation steps for common issues.
MediumTechnical
63 practiced
Implement mini-batch stochastic gradient descent for binary logistic regression in Python/NumPy. Include shuffling each epoch, L2 regularization (excluding bias), and a decaying learning rate schedule. Provide code outline and explain how you would vectorize updates for mini-batches.
HardTechnical
49 practiced
Explain logistic regression as a generalized linear model (GLM) with canonical logit link. Discuss the score function, Fisher information matrix, and how deviance is used as a goodness-of-fit measure. Contrast likelihood-based inference in GLMs with penalized maximum likelihood used in machine learning practice.

Unlock Full Question Bank

Get access to hundreds of Linear and Logistic Regression Implementation interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.