Interview Prep Guide

Data Scientist Interview Questions & Answers

The most common data science interview questions across statistics, machine learning, SQL, Python, and case study rounds — with detailed sample answers.

14+

Questions covered

4

Interview categories

15 min

Reading time

3 / month

Practice sessions free

Statistics & Probability

What is the difference between a p-value and a confidence interval?

A p-value is the probability of observing results at least as extreme as the data, assuming the null hypothesis is true. If p < α (commonly 0.05), you reject the null. A confidence interval gives a range of plausible values for the parameter — a 95% CI means 95% of intervals constructed this way would contain the true value. Both measure uncertainty, but CIs are often more informative because they show the magnitude of the effect.

Explain the bias-variance tradeoff.

Bias is the error from wrong assumptions (underfitting); variance is the error from sensitivity to training data fluctuations (overfitting). A simple model has high bias and low variance. A complex model has low bias and high variance. The goal is to find the sweet spot that minimises total error. Techniques like cross-validation help identify the right model complexity.

What is the Central Limit Theorem and why is it important?

The CLT states that the sampling distribution of the mean approaches a normal distribution as sample size increases, regardless of the population distribution. This is foundational: it allows us to make inferences about population parameters using sample statistics and underpins hypothesis testing and confidence intervals.

Machine Learning

What is the difference between bagging and boosting?

Bagging (e.g. Random Forest) trains multiple models in parallel on random subsets of data and averages predictions — it reduces variance. Boosting (e.g. XGBoost, AdaBoost) trains models sequentially, each correcting the errors of the previous — it reduces bias. Bagging is more robust to overfitting; boosting can achieve higher accuracy but is more sensitive to outliers.

How do you handle class imbalance in a classification problem?

Techniques include: (1) resampling — oversample the minority class (SMOTE) or undersample the majority, (2) class weights — penalise misclassifying the minority class more heavily, (3) use appropriate metrics — accuracy is misleading; use precision, recall, F1, AUC-ROC, (4) anomaly detection framing for extreme imbalance, (5) ensemble methods like balanced random forests.

Explain gradient descent and its variants.

Gradient descent minimises a loss function by updating parameters in the direction of the negative gradient. Variants: Batch GD uses all data (slow, stable), Stochastic GD uses one sample (fast, noisy), Mini-batch GD is the standard compromise. Adam and RMSprop are adaptive learning rate methods that converge faster in practice for deep learning.

What is regularisation and what problem does it solve?

Regularisation adds a penalty to the loss function to discourage overly complex models. L1 (Lasso) adds the sum of absolute weights — drives some weights to zero, useful for feature selection. L2 (Ridge) adds the sum of squared weights — keeps all weights small. ElasticNet combines both. The regularisation strength hyperparameter λ controls the tradeoff between fit and complexity.

SQL & Data Engineering

What is the difference between WHERE and HAVING in SQL?

WHERE filters rows before aggregation; HAVING filters groups after aggregation. Use WHERE for row-level conditions and HAVING for conditions on aggregated values (e.g. HAVING COUNT(*) > 10).

Explain window functions and give a use case.

Window functions perform calculations across a set of rows related to the current row without collapsing them into groups (unlike GROUP BY). Use cases: running totals (SUM OVER), rankings (RANK, ROW_NUMBER), moving averages, and lag/lead comparisons. Example: finding each customer's most recent order without a subquery.

How would you find duplicate rows in a table?

Use GROUP BY with HAVING COUNT(*) > 1 on the column(s) you consider the unique key. Example: SELECT email, COUNT(*) FROM users GROUP BY email HAVING COUNT(*) > 1. To delete duplicates, use a CTE with ROW_NUMBER() OVER (PARTITION BY ...) and delete rows where row_num > 1.

Behavioural & Case Study

Walk me through a data science project you are proud of.

Structure: problem definition, data collection and cleaning, exploratory analysis, model selection and training, evaluation, deployment, and business impact. Quantify results (e.g. "reduced churn by 12%"). Mention what you would do differently with more time.

How would you measure the success of a new feature?

Define the north star metric aligned to the business goal. Set up an A/B test with a pre-calculated sample size for statistical significance. Decide on the primary metric (e.g. conversion rate) and guardrail metrics (e.g. latency, churn) upfront. Analyse after the run period, check for novelty effects, and report confidence intervals not just p-values.

Pricing

Start free. Finish your loop.

First 3 rounds of any loop — for any of 31 companies — are completely free. Upgrade to Career when you're ready to finish.

MonthlyAnnualup to 33% off

Free

$0/month

First 3 rounds free — no card needed

  • 3 rounds free per loop (any of 31 companies)
  • Resume + JD personalisation
  • 3 AI interviews / month
  • Text, voice & video modes
  • AI scorecards & feedback
  • Job tracker (5 applications)
  • Resume analysis

Executive

$49/month

For senior & leadership candidates

  • Everything in Career
  • Executive & VP-level question banks
  • C-suite interview simulations
  • Offer & comp negotiation coaching
  • LinkedIn profile AI strategy
  • Dedicated career strategy AI
  • Priority support

Enterprise

Custom

For bootcamps, universities & L&D teams

  • Custom seat count
  • SSO & advanced security
  • SLA guarantee
  • Dedicated customer success
  • Custom question banks
  • Cohort analytics & reporting
  • White-labelling available
Book a Demo

Your dream company. Every round.

31 companies. First 3 rounds free.

Frequently asked questions

What is the difference between a data scientist and a data analyst?

Data analysts primarily work with existing data to answer business questions using SQL, Excel, and dashboards. Data scientists build predictive models, design experiments, and often write production code. The line blurs across companies, so read the job description carefully.

Do data scientist interviews always include coding?

Yes, most data scientist roles include a Python coding round (data manipulation with pandas, implementing ML algorithms from scratch) and SQL round. Some companies also include take-home case studies where you analyse a dataset and present findings.

What Python libraries should I know for data science interviews?

Core: numpy (arrays), pandas (data manipulation), scikit-learn (ML algorithms), matplotlib/seaborn (visualisation). For deep learning roles: PyTorch or TensorFlow. For production roles: MLflow, Airflow, FastAPI.

How do I prepare for data science case study interviews?

Practice structuring your thinking: clarify the problem, ask about data availability, propose metrics, suggest a modelling approach, discuss trade-offs, and quantify expected impact. NeuralHire includes case study interview simulations with AI feedback on your analytical reasoning.