LeetCampus
Interview Question

Can you describe a situation where you would use linear regression over logistic regression?

July 2, 2026
0 views
Difficulty: Medium
Popularity: Common
Share on

Question Explanation

This question is commonly asked in statistics and data analysis interviews to assess a candidate's understanding of regression models and their appropriate applications. Interviewers are looking for candidates to demonstrate their knowledge of the fundamental differences between linear regression (used for predicting continuous outcomes) and logistic regression (used for binary outcomes). A common misconception is that both types of regression can be used interchangeably, but this is not the case. Linear regression should be used when the dependent variable is continuous, such as predicting a person's height based on age, while logistic regression is appropriate when the outcome is binary, like predicting whether a person will pass or fail an exam. Real-world applications of this question might involve scenarios such as forecasting sales figures (linear regression) versus predicting whether a customer will buy a product (logistic regression). The ability to choose the right model is crucial for accurate predictions and insights in data analysis.

Sample Answers

Example 1: Academic Project - Predicting Student Scores

During my final year in college, I worked on a project where we aimed to predict students' final exam scores based on their study hours and attendance. Since the scores were continuous, we opted for linear regression. We collected data on various students and created a model that helped us understand how much their study habits influenced their scores. By analyzing the results, we found that more study hours positively correlated with higher scores, reinforcing the importance of consistent study habits.

Example 2: Part-time Job - Analyzing Sales Data

In a part-time role at a retail store, I was tasked with analyzing monthly sales data. I noticed that sales figures were continuous and varied month to month. Using linear regression, I created a predictive model to forecast next month’s sales based on previous months' data, seasonal trends, and promotional events. This approach helped our team plan inventory better and increase sales by targeting specific promotions during peak months.

Example 3: First Internship - Evaluating Housing Prices

During my internship at a real estate firm, I was involved in a project analyzing housing prices in different neighborhoods. We used linear regression to predict house prices based on various factors like square footage, number of bedrooms, and location. By employing this model, we could provide clients with estimated prices, which helped them make informed decisions when buying or selling properties. This experience emphasized the importance of selecting the right regression model based on the data type.

Keywords

linear regressionlogistic regressionpredictive modelingdata analysisstatistics

Ready to practice more questions?

Explore our collection of technical interview questions from top companies.

View All Questions