50 Data Science Interview Questions and Answers (2026 Edition)
Data science interviews test statistics, ML concepts, coding, and problem-solving. These are the 50 questions that come up most often, with the answers hiring managers actually want to hear.
Statistics Questions
1. Type I vs Type II errors? Type I (false positive): rejecting a true null; probability = alpha (0.05). Type II (false negative): failing to reject a false null; power = 1 – beta.
2. What is p-value? The probability of results at least as extreme as yours, assuming H0 is true. NOT the probability your hypothesis is true. p below 0.05 = statistically significant — but not necessarily practically meaningful.
3. What is the Central Limit Theorem? Sample means approach normal as n grows, regardless of population distribution. Enables parametric tests when n is 30 or more.
4. Mean vs Median? Use median when data has outliers or is skewed — salary data is a classic example where a few high earners skew the mean.
5. Correlation vs Causation? Correlation = two variables move together. Causation = one causes the other. Ice cream sales and drowning rates correlate (both rise in summer) but ice cream does not cause drowning — temperature is the confounder.
Machine Learning Questions
6. Bias-variance tradeoff? Bias = error from wrong assumptions (underfitting). Variance = sensitivity to training data (overfitting). Simple models: high bias, low variance. Complex models: low bias, high variance. Goal: balance both.
7. What is regularisation? Penalty for large weights added to the loss function. L1 (Lasso) zeros out features. L2 (Ridge) shrinks all weights. Elastic Net combines both.
8. How does Random Forest work? Many decision trees, each on a bootstrap sample and random feature subset. Classification: majority vote. Regression: average. Reduces variance via bagging; reduces correlation via feature randomness.
9. Gradient descent variants? Batch GD: all data per update (stable, slow). SGD: one sample (noisy, fast). Mini-batch: a batch — the standard in deep learning.
10. Class imbalance? SMOTE oversample, undersample majority, class_weight=balanced in sklearn, threshold moving. Evaluate with AUC-ROC or F1 not accuracy.
11. Cross-validation? Split into k folds, train on k-1, test on 1, rotate k times. More reliable than single split. Stratified k-fold preserves class proportions.
12. Precision, recall, F1? Precision: correct out of predicted positives. Recall: caught out of actual positives. F1: harmonic mean. Use precision when false positives costly (spam); recall when false negatives costly (disease).
13. AUC-ROC? ROC plots TPR vs FPR at all thresholds. AUC: 0.5 = random, 1.0 = perfect. Threshold-agnostic, robust to class imbalance.
14. K-means limitations? Must specify k. Sensitive to initialisation (use k-means++). Assumes spherical clusters. Sensitive to outliers. Cannot find non-convex shapes.
15. Overfitting? Detect and prevent? Good training, poor test performance. Detect: large train/val accuracy gap. Prevent: regularisation, dropout, cross-validation, simpler model, more data, early stopping.
Python and SQL Questions
16. List vs Tuple? Lists are mutable. Tuples are immutable, faster, and hashable (usable as dict keys).
17. Missing values in Pandas? df.isnull().sum() to find. df.dropna() to drop. df.fillna(value) or df.fillna(df.median()) to fill. SimpleImputer for ML pipelines.
18. Second-highest salary SQL? SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees). Or DENSE_RANK() over ORDER BY salary DESC, select where rank=2.
19. WHERE vs HAVING? WHERE filters rows before GROUP BY. HAVING filters groups after GROUP BY and can use aggregate functions.
20. merge vs join in Pandas? pd.merge() is flexible — merges on any columns. df.join() merges on index. pd.concat() stacks DataFrames.
Feature Engineering and Deep Learning
21. When is scaling required? For gradient-based algorithms (logistic regression, SVM, KNN, NNs). Not required for tree-based models.
22. One-hot vs label encoding? One-hot for nominal (unordered) categories. Label encoding for ordinal data or tree models that handle it natively.
23. Feature selection vs dimensionality reduction? Feature selection keeps original features (Lasso, RFE). Dimensionality reduction transforms to fewer dimensions (PCA, t-SNE).
24. Backpropagation? Applies chain rule backward through network to compute loss gradients with respect to each weight. Optimiser uses these to update weights.
25. Transfer learning? Pre-trained model (ResNet, BERT) as starting point, fine-tuned on task-specific data. Reduces training time and data requirements dramatically.
Process and Product Questions
26. Approach to a new ML problem? Understand business problem, define metrics, EDA/cleaning, feature engineering, baseline, iterative improvement, rigorous evaluation, deploy, monitor.
27. Communicate to non-technical stakeholders? Lead with business impact not metrics: this reduces churn by 15% saving $2M annually — not AUC is 0.87. Use visuals. Show confusion matrix consequences. Be honest about uncertainty.
28. Good in training, poor in production? Check: train/serving skew, distribution shift, feature drift, target leakage, data pipeline bugs, model staleness.
29. Design a spam detection system? Features: sender reputation, TF-IDF subject, URL presence, email metadata. Model: gradient boosting or text+XGBoost. Precision high (no blocking legit email), recall reasonable. Online updates for new patterns.
30. Design a recommendation system? Offline metrics: Precision@K, Recall@K, NDCG. Online: CTR, revenue per session, A/B test vs baseline. Approaches: collaborative filtering, content-based, hybrid, two-tower models for scale.
Conclusion
Common interview mistakes: not clarifying the problem before jumping to solutions, conclusions without reasoning, algorithm details without business context. Practice talking through your thought process — interviewers want to see how you think, not just what you know.



