Top 25 Data Science Interview Questions with Answers (2026) — Freshers & Experienced both
Preparing for a Data Science interview can feel big syllabus, especially when you don’t know what interviewers are likely to ask.
Companies such as Amazon, Google, Flipkart, TCS, Infosys, and many startups regularly hire data science professionals, but their interviews can be challenging. To make your preparation easier, I’ve put together 25 commonly asked Data Science interview questions based on real interview experiences and commonly discussed interview topics.
Whether you’re a 2024 or 2025 fresher or have 1–2 years of experience, these questions will help you revise the concepts that frequently come up in interviews.
1. What is the difference between supervised and unsupervised learning?
Simple explanation:
The main difference is whether the training data has labels.
In supervised learning, the model learns from labeled data. For example, you can train a model using emails already marked as “spam” or “not spam.”
In unsupervised learning, there are no predefined labels. The model tries to discover patterns or groups in the data on its own. For example, you could group customers based on their purchasing behavior.
Easy way to remember:
Supervised = Learning with answers
Unsupervised = Finding patterns without answers
2. What is overfitting and how can you prevent it?
Simple explanation:
Overfitting happens when a model learns the training data too closely, including its noise and random patterns.
As a result, the model performs very well on training data but poorly on new, unseen data.
You can reduce overfitting by using:
- Cross-validation
- L1/L2 regularization
- Pruning in decision trees
- More training data
- Simpler models
- Dropout in neural networks
Example:
A student memorizes every question from a practice paper but struggles when the actual exam contains different questions. That’s similar to overfitting.
3. Explain the bias-variance tradeoff.
Simple explanation:
Bias and variance are two important sources of model error.
High bias means the model is too simple and may fail to capture important patterns. This usually causes underfitting.
High variance means the model is too sensitive to the training data. This usually causes overfitting.
The goal is to find a good balance between bias and variance so that the model performs well on both training and unseen data.
Remember:
High Bias → Underfitting
High Variance → Overfitting
4. What is a confusion matrix?
A confusion matrix is a table used to evaluate the performance of a classification model.
It contains four important values:
- True Positive (TP): Model predicts positive and the actual result is positive.
- True Negative (TN): Model predicts negative and the actual result is negative.
- False Positive (FP): Model predicts positive, but the actual result is negative.
- False Negative (FN): Model predicts negative, but the actual result is positive.
These values are used to calculate metrics such as:
- Accuracy
- Precision
- Recall
- F1 Score
5. What is the difference between precision and recall?
Precision answers:
“Out of everything the model predicted as positive, how many were actually positive?”
Recall answers:
“Out of all the actual positive cases, how many did the model correctly identify?”
For example, in a fraud detection system, if false alarms are very costly, you may want higher precision. If missing an actual fraud case is more dangerous, you may prioritize recall.
Easy trick:
Precision → Predicted positives
Recall → Actual positives
6. What is cross-validation?
Cross-validation is a technique used to get a more reliable estimate of how well a machine learning model performs.
In K-fold cross-validation, the dataset is divided into K parts.
The model trains on K-1 parts and tests on the remaining part. This process is repeated until every part has been used as the validation set.
For example, with 5-fold cross-validation:
- Train on 4 parts
- Test on 1 part
- Repeat 5 times
- Calculate the average performance
This is generally more reliable than relying on a single train-test split.
7. What is the difference between a Decision Tree and Random Forest?
A Decision Tree is a single tree that makes decisions by splitting the data based on different features.
A Random Forest combines multiple decision trees and uses their combined predictions to produce the final result.
Because it combines many trees, Random Forest generally reduces overfitting compared with a single decision tree and often provides better generalization.
Remember:
Decision Tree = One tree
Random Forest = Many trees working together
8. What is regularization? Explain L1 and L2 regularization.
Regularization is a technique used to reduce overfitting by adding a penalty to the model’s loss function.
There are two commonly used types:
L1 Regularization — Lasso
L1 adds a penalty based on the absolute values of the model coefficients.
It can push some coefficients exactly to zero, which makes it useful for feature selection.
L2 Regularization — Ridge
L2 adds a penalty based on the squared values of the coefficients.
It generally keeps all features but reduces the size of their coefficients.
Easy trick:
L1 → Can make coefficients zero
L2 → Makes coefficients smaller
9. What is Gradient Descent?
Gradient Descent is an optimization algorithm used to minimize a model’s loss or cost function.
The algorithm calculates the gradient, which tells us the direction in which the loss increases, and then moves in the opposite direction.
The learning rate controls how large each step is.
If the learning rate is too large, the algorithm may overshoot the minimum. If it is too small, training can take a long time.
Simple example:
Imagine you’re standing on a hill and want to reach the lowest point. You keep taking steps downhill until you reach the bottom.
10. What is the difference between Bagging and Boosting?
Both are ensemble learning techniques, but they work differently.
Bagging
Multiple models are trained independently, often in parallel, and their predictions are combined.
Example: Random Forest.
Boosting
Models are trained sequentially. Each new model focuses more on correcting the mistakes made by previous models.
Examples: AdaBoost and XGBoost.
Easy trick:
Bagging → Models work independently
Boosting → Models work sequentially
11. What is PCA?
PCA (Principal Component Analysis) is a dimensionality reduction technique.
It transforms a dataset with many features into a smaller number of new features called principal components, while trying to preserve as much of the important variation in the data as possible.
PCA can be useful when:
- There are many features
- Features are highly correlated
- You want to reduce computation
- You want to visualize high-dimensional data
12. How do you handle missing values in a dataset?
There isn’t one solution that works for every dataset. The approach depends on the data and the reason values are missing.
Common methods include:
- Removing rows with missing values
- Filling missing values with the mean
- Using the median
- Using the mode
- Forward or backward filling for time-series data
- Predicting missing values using a machine learning model
Important interview point:
Don’t blindly fill every missing value with the mean. First understand why the data is missing and what type of variable it is.
13. What is the difference between correlation and causation?
Correlation means two variables are related or tend to change together.
Causation means a change in one variable directly causes a change in another.
For example, ice cream sales and drowning incidents may both increase during summer. They are correlated, but buying ice cream does not cause drowning.
The common factor is the warmer weather.
Remember:
Correlation = They move together
Causation = One causes the other
14. What is a p-value?
A p-value helps us understand how compatible our observed result is with the null hypothesis.
A small p-value means the observed result would be relatively unlikely if the null hypothesis were true.
In many statistical tests, 0.05 is used as a significance threshold. However, a p-value below 0.05 does not automatically prove that a result is important or that the alternative hypothesis is true.
Interview tip:
Avoid saying simply, “p-value is the probability that the null hypothesis is true.” That is a common misconception.
15. Explain the Central Limit Theorem.
The Central Limit Theorem (CLT) says that when we take sufficiently large random samples from a population, the distribution of the sample means tends to become approximately normal, even if the original population is not normally distributed.
This concept is extremely important in statistics because it helps us make estimates and perform statistical tests.
Easy way to remember:
Different population → Large samples → Sample means become approximately normal.
16. What is the difference between Type I and Type II errors?
There are two common types of errors in hypothesis testing.
Type I Error
You reject the null hypothesis even though it is actually true.
This is a false positive.
Type II Error
You fail to reject the null hypothesis even though it is actually false.
This is a false negative.
Easy trick:
Type I → False Positive
Type II → False Negative
17. What is Feature Engineering?
Feature engineering means creating, transforming, or selecting features in a way that helps a machine learning model learn better.
For example, suppose you have a date_of_birth column.
Instead of giving the model the raw date, you might calculate:
- Age
- Birth year
- Age group
Another example is creating a price-per-unit feature from total price and quantity.
Good feature engineering can significantly improve model performance.
18. What is the difference between RMSE and MAE?
Both RMSE and MAE are commonly used to evaluate regression models.
MAE — Mean Absolute Error
It calculates the average absolute difference between actual and predicted values.
It is relatively easy to interpret and is less sensitive to large errors.
RMSE — Root Mean Squared Error
It squares the errors before averaging them and taking the square root.
Because errors are squared, RMSE gives more weight to large errors.
Remember:
MAE → More straightforward, less sensitive to outliers
RMSE → Penalizes large errors more strongly
19. What is A/B testing?
A/B testing is an experiment where users are divided into different groups and shown different versions of a product or feature.
For example:
- Group A → Old website button
- Group B → New website button
You then compare a metric such as conversion rate to determine whether the new version performs better.
A/B testing is widely used in:
- Product development
- Marketing
- E-commerce
- User experience optimization
20. Explain ROC Curve and AUC.
The ROC (Receiver Operating Characteristic) curve shows the relationship between:
- True Positive Rate
- False Positive Rate
at different classification thresholds.
AUC (Area Under the ROC Curve) summarizes the model’s ability to distinguish between positive and negative classes.
Generally:
- AUC = 1 → Excellent discrimination
- AUC = 0.5 → No better than random ranking
- AUC < 0.5 → Worse than random, though the interpretation depends on how the scores are defined
21. What is the difference between Machine Learning and Deep Learning?
Machine Learning is a broad field where algorithms learn patterns from data and use those patterns to make predictions or decisions.
Deep Learning is a subset of machine learning that uses multi-layer neural networks.
Deep learning is particularly powerful for unstructured data such as:
- Images
- Audio
- Video
- Text
However, deep learning models often require more data, computational resources, and training time.
Remember:
Deep Learning ⊂ Machine Learning
22. What is the Curse of Dimensionality?
The curse of dimensionality refers to the problems that arise when the number of features becomes very large.
As dimensions increase, data points become increasingly sparse, distances can become less meaningful, and models may require much more data to learn effectively.
This can make machine learning models slower and less effective.
Techniques such as:
- PCA
- Feature selection
- Feature extraction
can help reduce these problems.
23. What is Time Series Analysis?
Time series analysis deals with data collected over time and in a meaningful sequence.
Examples include:
- Daily stock prices
- Monthly sales
- Hourly website traffic
- Daily temperature
Time series analysis can help identify:
- Trends
- Seasonality
- Cycles
- Patterns
and can be used for forecasting future values.
Common techniques include ARIMA, SARIMA, exponential smoothing, and various machine learning or deep learning approaches.
24. What is the difference between Parametric and Non-Parametric models?
Parametric models make assumptions about the underlying relationship or distribution and have a fixed or predetermined number of parameters.
For example, linear regression assumes a particular functional form between the dependent and independent variables.
Non-parametric models make fewer assumptions about the underlying relationship and can adapt to more complex patterns.
Examples include:
- K-Nearest Neighbors
- Decision Trees
Remember:
Parametric → More assumptions
Non-parametric → More flexibility
25. How would you explain a Machine Learning model to a non-technical stakeholder?
This question is testing your communication skills, not just your technical knowledge.
Avoid overwhelming the stakeholder with terms such as Random Forest, hyperparameters, regularization, or gradient descent.
Instead, explain what the model does in terms of the business problem.
For example, instead of saying:
“We built a Random Forest classification model.”
You could say:
“We built a system that identifies customers who are more likely to leave, so the sales team can contact them before they decide to leave.”
The second explanation focuses on the business impact, which is usually what the stakeholder cares about.
Final Interview Tip
Don’t just memorize these 25 answers.
The interviewer may ask a follow-up question such as:
- “Can you give me a real-world example?”
- “Why did you choose this algorithm?”
- “What happens if the data is imbalanced?”
- “How would you improve this model?”
- “Which metric would you use and why?”
So, while preparing, practice explaining every concept in your own words.
A good approach is:
Understand → Explain → Give an example → Discuss when to use it
Remember, companies such as Google, Amazon, Flipkart, TCS, and Infosys aren’t only checking whether you remember definitions. They also want to see how you approach problems, make decisions, and communicate your reasoning.
If you’re preparing for a Data Science interview, save these questions and practice them before your next interview.
Good luck with your preparation!