Data science interviews usually have four rounds: statistics, machine learning concepts, Python and SQL coding, and a case study about a business problem. This guide gives you 25 of the most common questions across those rounds, with answers that show understanding rather than textbook definitions.
If you are earlier in your journey, follow our data science roadmap first, then come back to this list four to six weeks before you apply.
Statistics and probability
1. What is the difference between mean and median, and when do you use each?
The mean is the average; the median is the middle value. Use the median when data is skewed or has outliers, such as salaries or house prices, because a few extreme values pull the mean away from what is typical.
2. What is a p-value?
The probability of seeing a result at least as extreme as yours if the null hypothesis were true. A small p-value (commonly below 0.05) suggests the result is unlikely to be random chance. It does not tell you how large or important the effect is.
3. Type I vs Type II error?
A Type I error is a false positive: you conclude there is an effect when there is none. A Type II error is a false negative: you miss a real effect. In a medical test, a Type II error (missing a disease) is often more costly.
4. What is the central limit theorem?
When you take many random samples and average each one, the averages form a roughly normal distribution as sample size grows, whatever the shape of the original data. That is why confidence intervals and many tests work.
5. How would you design an A/B test?
- Define one primary metric, such as conversion rate.
- Calculate the sample size needed for the smallest effect you care about.
- Randomly split users and run the test for full weeks to cover weekday patterns.
- Check the result for significance and practical impact before rolling out.
Machine learning concepts
6. Supervised vs unsupervised learning?
Supervised learning uses labelled data to predict an outcome, such as predicting loan default. Unsupervised learning finds structure in unlabelled data, such as grouping customers into segments with clustering.
7. What is overfitting and how do you prevent it?
Overfitting means the model learns noise in the training data and performs poorly on new data. Prevent it with more data, simpler models, regularisation (L1 or L2), cross-validation, early stopping and removing leaky features.
8. Explain the bias-variance trade-off.
Bias is error from a model that is too simple; variance is error from a model that is too sensitive to the training data. Increasing complexity lowers bias but raises variance. The goal is the point where total error on unseen data is lowest.
9. Which metric would you use for an imbalanced classification problem?
Not accuracy. If only 1% of transactions are fraud, predicting not-fraud for everything is 99% accurate and useless. Use precision, recall, F1 score or the area under the precision-recall curve, chosen by which mistake is more expensive.
| Metric | Question it answers |
|---|---|
| Precision | Of the cases we flagged, how many were right? |
| Recall | Of the real cases, how many did we catch? |
| F1 | A balance of precision and recall |
10. How does a random forest work?
It trains many decision trees on random samples of rows and random subsets of features, then combines their votes. Averaging many varied trees reduces variance, so it overfits less than a single tree.
11. Bagging vs boosting?
Bagging trains models independently in parallel and averages them (random forest). Boosting trains models one after another, each fixing the errors of the previous one (XGBoost, LightGBM). Boosting is often more accurate on tabular data but easier to overfit.
12. How do you handle missing values?
First ask why they are missing. Then drop columns that are mostly empty, impute numbers with the median and categories with the most frequent value or a separate missing label, and consider adding a flag column, because missingness itself can be informative.
13. What is cross-validation?
Splitting the data into k parts, training on k-1 parts and testing on the remaining one, then repeating k times. It gives a more reliable estimate of performance than a single train-test split.
14. What is data leakage?
When information that would not be available at prediction time sneaks into training, such as using a refund date to predict whether an order will be refunded. It produces great test scores and poor real-world results.
Python and SQL coding
15. Find the top 3 products by revenue with pandas.
top3 = (df.assign(revenue=df['price'] * df['qty'])
.groupby('product')['revenue'].sum()
.nlargest(3))
16. The same question in SQL.
SELECT product, SUM(price * qty) AS revenue
FROM orders
GROUP BY product
ORDER BY revenue DESC
LIMIT 3;
17. What is the difference between loc and iloc?
loc selects by labels (index names and column names). iloc selects by integer position. df.loc[5] means the row labelled 5; df.iloc[5] means the sixth row.
18. Train a simple model with scikit-learn.
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, stratify=y, random_state=42)
model = RandomForestClassifier(n_estimators=300, random_state=42)
model.fit(X_train, y_train)
print(classification_report(y_test, model.predict(X_test)))
19. How do you handle a dataset too large for memory?
Read it in chunks with pd.read_csv(..., chunksize=100_000), select only the needed columns, use smaller data types, or move to tools built for scale such as Polars, DuckDB or Spark.
Case study and project questions
20. How would you predict customer churn?
Define churn clearly (for example, no purchase in 60 days), build features such as recency, frequency, spend and support tickets, train a classification model, evaluate with recall on churners, and explain which features drive risk so the business can act.
21. Sales dropped 15% last month. How do you investigate?
Check data quality first, then split the drop by region, channel, product and customer type to find where it is concentrated. Compare with seasonality and last year, and look for external causes such as a price change or a site outage.
22. How do you explain a model to non-technical people?
Lead with the business result, use one or two plain examples, and show the main drivers with a simple chart. Tools such as SHAP values help you explain individual predictions.
23. What happens after a model is deployed?
Monitor input data and prediction quality for drift, log predictions, retrain on a schedule or when performance drops, and keep a simple rollback to the previous model.
24. Walk me through your best project.
Use this structure: the problem and why it mattered, the data, what you tried, the final model and metric, the business impact, and what you would do differently. Keep it to three minutes.
25. Why do you want to work in data science?
Connect a real example of using data to answer a question with what the company does. Specific beats generic every time.
Frequently asked questions
Do freshers get data scientist jobs?
Some do, but many start as data analysts or junior ML engineers and move into data science within one to two years. Strong projects and SQL skills make the biggest difference.
How much maths is asked in interviews?
Mostly applied statistics and probability, plus intuition for linear algebra and gradient descent. You rarely need to derive formulas, but you must explain what they do.
Which is more important, Python or SQL?
Both. SQL is tested in almost every data interview, and Python is used for analysis and modelling. Practise them equally.
See more data science and AI tutorials, or brush up your query skills with our SQL interview questions.