Home › Blog › Data scientist onsite questions

Data Scientist Onsite Interview Questions: 30 Examples by Round

SQL, statistics, product cases, machine learning and behavioral rounds, with what a strong answer covers in each.

Data scientist onsite interview questions typically come in five rounds: SQL and coding, statistics and A/B testing, a product or metric case, machine learning, and behavioral. Below are 30 example questions grouped by round, with what interviewers expect in each answer, especially the assumptions, metric choices and pitfalls that separate a pass from a strong pass.

We wrote these questions to reflect common patterns, not any one company's list. The balance between rounds depends heavily on the role: a product analytics data scientist will spend more time on metrics and experiments, while a machine learning–focused data scientist will see more modeling and coding. Ask your recruiter which track you are on. For a broader question bank with sample answers, see our data scientist interview questions guide.

What rounds are in a data scientist onsite interview?

A data science onsite is commonly four to five interviews of 45 to 60 minutes. Each interviewer owns one skill area and writes separate feedback, which the hiring team reviews together afterward. Our hub on how to prepare for an onsite interview covers logistics and timing; the table below covers the content.

RoundWhat it testsWhat interviewers listen for
SQL / codingGetting correct data out of tables; basic Python or RClarifying the grain of the table, handling NULLs and duplicates, checking the result
Statistics / A/B testingExperiment design and interpretationHypotheses, sample size, randomization unit, guardrails, no peeking
Product / metric caseTurning a business question into an analysisMetric definitions, segmentation, trade-offs, a clear recommendation
Machine learningChoosing, training and evaluating modelsA baseline first, the right evaluation metric, leakage awareness
BehavioralCommunication, influence, ownershipResults in numbers, how your analysis changed a decision

Some loops add a presentation of a take-home analysis or a project deep dive. If you have one, our guide to the take-home assignment interview covers how to present it.

SQL and coding questions

SQL rounds are usually done in a shared editor, sometimes without running the query. Before writing anything, confirm what one row of each table represents and how the tables join. Then say how you would check the output.

  1. "Find the seven-day rolling average of daily active users." Expect a window function. Mention how you handle days with no activity, which can disappear from the result.
  2. "Return each user's first purchase and the days until their second." Tests ROW_NUMBER() or LAG() and careful handling of users with only one purchase.
  3. "Calculate the 30-day retention rate by sign-up week." Define retention precisely first: active on day 30, or at any time between days 28 and 30?
  4. "Find the top three products by revenue in each category." Discuss ties and whether you would use RANK() or DENSE_RANK().
  5. "This query double-counts revenue. Why?" Usually a one-to-many join. Say how you would detect it by comparing row counts before and after the join.
  6. "In Python, write a function that computes the median of a stream of numbers." Tests data structures (two heaps). State the time complexity.
  7. "Clean a dataset of transactions with duplicate and missing values." Explain the rules you would apply and why, rather than dropping rows silently.

For more practice queries, our SQL interview questions and LeetCode SQL 50 guide go deeper.

Statistics and A/B testing questions

This round tells interviewers whether they can trust your experiment results. The single most common trap is peeking: checking a test repeatedly and stopping as soon as it looks significant. Evan Miller's widely cited 2010 article "How Not To Run an A/B Test" shows that this practice makes the reported significance levels meaningless; fix the sample size in advance or use a method designed for sequential testing. For a full reference, many practitioners use Trustworthy Online Controlled Experiments by Kohavi, Tang and Xu (Cambridge University Press, 2020).

  1. "How would you design an A/B test for a new checkout button?" Cover the hypothesis, primary metric, guardrail metrics, randomization unit, sample size and run length.
  2. "The test is significant after two days. Can we ship?" Raise peeking, day-of-week effects and novelty effects before you agree.
  3. "Explain a p-value to a product manager." Keep it plain: how surprising the result would be if the change had no effect. Avoid saying it is the probability the hypothesis is true.
  4. "How do you calculate the sample size for a test?" Name the inputs: baseline rate, minimum detectable effect, significance level and power.
  5. "What do you do when the treatment and control groups are different sizes than planned?" Check for a sample ratio mismatch, which often signals a bug in assignment or logging.
  6. "We cannot randomize users for this change. How do we measure impact?" Discuss alternatives such as difference-in-differences or a geographic split, and their assumptions.
  7. "You test 20 metrics and one is significant. What do you conclude?" Explain multiple comparisons and why you set a primary metric in advance.

Example answer outline we wrote for question 8: "The hypothesis is that a more visible checkout button increases completed purchases. The primary metric is purchases per visitor who reaches the cart, with guardrails on average order value, refund rate and page load time. I'd randomize by user, not by session, so the same person always sees the same version. With a baseline conversion rate and the smallest lift worth shipping agreed with the PM, I'd calculate the sample size at 5% significance and 80% power, and run for at least one or two full weeks to cover weekday and weekend behavior. I would not stop early on a promising result. Before reading the outcome, I'd check that the split between groups matches the plan, then report the effect with a confidence interval and a launch recommendation."

Tip: In experiment questions, say what would make you not trust the result. Interviewers often score skepticism as highly as the design itself.

Product and metric case questions

The product case is where data scientists most often lose points by jumping into analysis without defining the metric. Clarify the goal, define the metric precisely, segment, form hypotheses and finish with a recommendation.

  1. "Weekly orders dropped 5%. How would you investigate?" Check data pipeline issues first, then segment by platform, region, user cohort and acquisition channel.
  2. "How would you measure the success of a new search feature?" Propose one primary metric, such as searches that end in a purchase, plus guardrails like latency.
  3. "Should we send more push notifications?" Weigh short-term engagement against opt-outs and uninstalls, and propose a test.
  4. "Define a 'healthy' user for a subscription product." Interviewers want a definition tied to retention, and an explanation of how you would validate it.
  5. "Average session length went up but revenue went down. Why?" Consider mix shifts (Simpson's paradox), a slower experience or a change in which users are active.
  6. "How would you choose a north-star metric for a two-sided marketplace?" Discuss both sides and why a transaction-level metric is often preferred.

Machine learning questions

ML rounds for data scientists usually focus on applied judgement over theory. Always start with a simple baseline and a clear evaluation metric before suggesting complex models. If your role leans toward building production models, see our machine learning engineer interview questions and the ML system design interview guide.

  1. "Build a model to predict customer churn." Define churn and the prediction window, pick features available at prediction time, start with logistic regression and choose a metric suited to the class balance.
  2. "Your model has 99% accuracy. Is it good?" Ask about class balance. With rare events, precision, recall or PR-AUC tell you more.
  3. "What is data leakage? Give an example." For example, a feature recorded after the outcome, such as a cancellation reason used to predict cancellation.
  4. "How would you explain the bias-variance trade-off?" Use a concrete example, such as tree depth, and what you would change if the model overfits.
  5. "How do you know a model is ready to ship?" Offline metrics, a comparison with the current approach, an online test and monitoring for drift.

Behavioral questions for data scientists

Behavioral interviewers want proof that your work changed decisions. Use the STAR method and include a number in the result: revenue, time saved or a decision made differently.

  1. "Tell me about an analysis that changed a product decision." Name the decision, what the data showed and what happened after.
  2. "Tell me about a time stakeholders disagreed with your findings." Show how you checked your work, explained limits and kept the relationship.
  3. "Describe a project where the data was messy or incomplete." Explain the trade-offs you accepted and how you communicated the uncertainty.
  4. "How do you explain technical results to non-technical people?" Lead with the decision, then the evidence, then the caveat.
  5. "Tell me about a time an experiment you ran gave a surprising result." Show the checks you ran before believing it.

Other roles share some of these rounds. Compare with our lists of data analyst onsite interview questions and the machine learning engineer onsite if you are applying across tracks.

How should you practice for a data science onsite?

Write SQL on paper or in a plain editor, then practice the spoken rounds aloud, because explaining an experiment clearly is a separate skill from knowing statistics.

Practice your case and stats answers out loud

Answer data science questions in a free AI mock interview and get a score out of 10 with what to tighten for each answer. Runs in your browser, nothing to install.

Try a free AI mock interview

FAQ

How many rounds are in a data scientist onsite?

Commonly four to five interviews of 45 to 60 minutes, covering SQL or coding, statistics and experiments, a product case, machine learning and behavioral questions. The balance depends on whether the role is analytics-focused or modeling-focused.

Do data scientist onsites include live coding?

Usually yes, at least SQL. Many also include a Python or R exercise focused on data manipulation rather than complex algorithms. Ask your recruiter which language and editor you will use.

What statistics should I review for a data science onsite?

Hypothesis testing, p-values and confidence intervals, sample size and power, multiple comparisons, and common experiment pitfalls such as peeking, novelty effects and sample ratio mismatch.

What is peeking in A/B testing?

Peeking is checking a test repeatedly and stopping once results look significant. It inflates false positives, so fix the sample size in advance or use a sequential testing method.

How do I approach a product case question as a data scientist?

Clarify the goal, define the metric precisely, check data quality, segment the problem, form hypotheses, propose an analysis or test and finish with a recommendation.

How should I prepare for the machine learning round?

Practice end-to-end walkthroughs: problem framing, features, a baseline model, evaluation metric, leakage checks and how you would monitor the model after launch.