OLS Slope + Intercept Sum in O(1)

Sum of regression slope and intercept is an easy quant interview question on Linear Regression, reported to have been seen at Squarepoint Capital.

Difficulty Easy Topic Linear Regression Reported at Squarepoint Capital

MyQuantPartner is not affiliated with, endorsed by, or sponsored by these companies, and all trademarks belong to their respective owners.

This quant interview question is about understanding how a simple linear regression line is chosen to best summarize a small dataset. Even though the numbers look basic, the problem is really probing whether you grasp what an ordinary least squares fit represents, not just how to plug into a memorized formula. It sits at the intersection of probability, statistics, and optimization, which are all central themes in quant prep and quantitative finance interviews.

It trains your command of OLS regression, moments such as means and covariances, and your ability to manipulate statistical quantities quickly and reliably. You are pushed to recognize the structure of the model, keep track of sample relationships, and extract the right aggregate quantity without getting lost in algebra.

This matters in quant interviews because linear models underlie factor modeling, risk premia estimation, signal construction, and PnL attribution. Interviewers want to see that you can move comfortably between data points, summary statistics, and model parameters in your head. Demonstrating speed and accuracy on this kind of regression question signals that you are ready for more advanced quant prep topics like multivariate regression, time-series models, and portfolio optimization.

What it tests

The core structure behind ordinary least squares (OLS) regression is the minimization of the sum of squared vertical deviations between observed points and the fitted line. This process always yields a unique linear relationship by projecting the observed data onto the space of lines, ensuring the residuals (errors) are orthogonal to the fitted values. The estimators for the slope and intercept are derived from the sample means and the covariances of the variables, exploiting the fact that the best linear predictor in the least-squares sense is determined by aligning the direction of the line with the direction of maximal covariance between the variables. The principle holds because, for any set of points, the least-squares solution is the unique line that balances the data's spread in $x$ and $y$ so that the average error is minimized and the line passes through the point $(\bar{x}, \bar{y})$. This geometric and algebraic structure is universal for all OLS problems, regardless of the specific data.

Practise this question with written feedback, or hear it in a spoken mock interview.

Get started free