# Data analyst interview questions, with sample answers

> Data analyst interview questions on SQL, statistics, business cases and behavior, with sample answers, the topics to review and how interviewers evaluate you.

- Canonical URL: https://jobbie.bot/blog/data-analyst-interview-questions
- Topic: [Interviews](https://jobbie.bot/guides/interviews)
- Published by [Jobbie](https://jobbie.bot/) · Updated 2026-10-06 · 8 min read

Data analyst interviews have four recurring parts: SQL, statistics, a business case and behavioral questions, often with a walk-through of a project from your portfolio. Across all of them, interviewers are checking one thing: whether you can turn a vague business question into a correct analysis and explain the result to someone who is not technical.

Say your assumptions aloud, check for traps in the data such as nulls and duplicates, and finish with what the business should do.

## Key takeaways

- Review SQL first: joins, `GROUP BY` with `WHERE` and `HAVING`, window functions, nulls and duplicates.
- Statistics questions test interpretation more than formulas: what a p-value means, what it does not mean, and when a significant result is too small to matter.
- In a case question, pin down the metric and the decision before you touch the data, and rule out a data problem first.
- Think aloud. State assumptions, test your query against an edge case and turn the result into a recommendation.
- Rehearse a two-minute walk-through of one project, from the question to what changed because of it.

## What a data analyst interview covers and how it is evaluated

| Part | What it looks like | What interviewers evaluate |
| --- | --- | --- |
| SQL | Live query writing or a timed online test on a few related tables | Correct joins and grouping, handling of nulls, duplicates and ties, readable code |
| Statistics | Concept questions, or an A/B test to interpret | Sound reasoning about uncertainty in plain language |
| Business case | An open problem, such as a metric that dropped | Clarifying questions, structure, choice of metrics, a clear recommendation |
| Project walk-through or take-home task | You present an analysis you did | Why you made each choice, honesty about limits, the decision it led to |
| Behavioral | Past examples with stakeholders, deadlines and mistakes | Communication, judgment and ownership |

The mix depends on the employer and on the tools named in the posting. If it lists Python, R, Excel or a dashboard tool, expect questions on them. [How to prepare for a technical interview](https://jobbie.bot/blog/technical-interview-preparation) covers formats such as timed tests and take-home tasks.

## Data analyst interview questions by what they test

**SQL**

- What is the difference between an inner join and a left join?
- What is the difference between `WHERE` and `HAVING`?
- How do `COUNT(*)`, `COUNT(column)` and `COUNT(DISTINCT column)` differ?
- Write a query to find the top three products by revenue in each category.
- How would you find duplicate rows in a table?
- How would you calculate a running total or a seven-day moving average?
- Find the customers who ordered in January but not in February.

**Statistics and experiments**

- What is a p-value, and what does it not tell you?
- Explain a confidence interval to a marketing manager.
- When would you report the median instead of the mean?
- How would you design an A/B test for a new checkout page?
- A test shows a statistically significant lift of 0.2%. Should we ship it?
- What is the difference between correlation and causation?

**Business cases and metrics**

- Weekly active users dropped 10% last week. How would you investigate?
- How would you measure whether a new feature is working?
- Two reports show different revenue numbers. How do you find out which is right?

**Data quality and tools**

- How do you check a dataset before you analyze it?
- How do you handle missing values and outliers?
- How have you used Excel, Python or R alongside SQL?

**Behavioral and communication**

- Walk me through a project in your portfolio.
- Tell me about an analysis that changed a decision.
- Tell me about a time a stakeholder asked for something unclear.
- Tell me about a time you found a mistake in your own work.
- How do you explain a technical result to a non-technical audience?

## SQL and statistics topics to review

| Topic | What to know cold |
| --- | --- |
| Joins | An inner join keeps only rows that match. A left join keeps every row of the left table and fills the right table’s columns with nulls where there is no match. A one-to-many join repeats rows, so compare row counts before and after |
| Filtering groups | `WHERE` filters individual rows before grouping. `HAVING` filters the groups that `GROUP BY` creates |
| Counting and nulls | `COUNT(*)` counts rows. `COUNT(column)` counts only the rows where that column is not null. `SUM` and `AVG` skip nulls |
| Window functions | They calculate across related rows without collapsing them into one row. They are not allowed in `WHERE`, so filter on them in an outer query |
| P-values | The probability of a result at least as extreme as the one observed, if the null hypothesis is true. Not the probability that the hypothesis is true, and not a measure of how large an effect is |
| Confidence intervals | How to explain one in plain words, and why less data means a wider interval |
| Experiments | Random assignment, a primary metric and a sample size chosen before the test starts, and why checking results early is risky |

The SQL rows follow the PostgreSQL documentation. Syntax details vary by database, so find out which one the employer uses.

## Sample answers to data analyst interview questions

```Sample answer: “Find the top three products by revenue in each category”
I'd total revenue per product, rank products inside each category with a window function, then filter in an outer query, because a window function can't go in WHERE.

WITH ranked AS (
  SELECT
    category,
    product_id,
    SUM(revenue) AS total_revenue,
    RANK() OVER (
      PARTITION BY category
      ORDER BY SUM(revenue) DESC
    ) AS revenue_rank
  FROM sales
  GROUP BY category, product_id
)
SELECT category, product_id, total_revenue
FROM ranked
WHERE revenue_rank <= 3;

One question: how should ties be handled? RANK keeps them, so a category could return more than three rows. To cap it at three, I'd use ROW_NUMBER with a tie-breaker in the ORDER BY.
```

Why it works: the approach is stated before the code, the query is built in readable steps, and the candidate raises the edge case without being asked.

```Sample answer: “What is a p-value, and what does it not tell you?”
A p-value is the probability of seeing a result at least as extreme as ours if the null hypothesis were true. In an A/B test, the null hypothesis is usually that the two versions perform the same. So a p-value of 0.03 means that if there were really no difference, we'd see a gap at least this large about 3% of the time.

It isn't the probability that the null hypothesis is true, and it says nothing about how big the effect is. With enough traffic, a tiny lift can be statistically significant. So I report the estimated effect and its confidence interval next to the p-value, and let the size of the effect drive the decision.
```

Why it works: the definition is precise, the two common misreadings are named, and the answer ends with what the analyst would do. The American Statistical Association’s statement on p-values makes the same two cautions.

```Sample answer: “Weekly active users dropped 10% last week. How would you investigate?”
First I'd check that the drop is real. Has the definition of the metric changed, did tracking or a data pipeline break, and was there a holiday or an outage?

If it's real, I'd find where it lives by splitting it: new versus returning users, platform, country, acquisition channel and app version. A drop concentrated in one segment, say Android users on the latest release, points to a cause. A drop spread evenly makes me look at seasonality.

Then I'd look at the funnel. Are fewer people arriving, or are the same people coming back less often?

I'd finish with a short note: what we know, what we've ruled out, the most likely cause and the next check.
```

Why it works: it rules out bad data first, narrows the problem by segment before guessing at causes, and ends with a deliverable.

```Sample answer: “Tell me about a time you found a mistake in your own work”
Last year I sent our sales director a report showing that average order value had jumped 18% after a pricing change. The next morning I saw that my join to the refunds table had duplicated orders with more than one refund line.

I reran it, and the real increase was 6%. I told the director that day, before the number reached the leadership meeting, and sent a corrected report with a one-line explanation.

Since then my template checks row counts before and after every join.
```

Why it works: the error is specific and technical, the candidate corrects it before being asked, and the fix is a habit, not a promise.

## How to walk through a portfolio project

Expect to be asked about one project in depth, whether it comes from a job, a course or your own [portfolio website](https://jobbie.bot/blog/portfolio-website). Pick one where you made real choices, and practice telling it in two minutes.

```Project walk-through: two-minute outline
1. The question: who needed to know what, and why it mattered
2. The data: where it came from, how big it was and what was wrong with it
3. The method: what you did and one alternative you rejected
4. The result: the main finding, with one number
5. The decision: what changed because of it
6. The limits: what you would do with more time or better data
```

Expect follow-up questions on step 3. “Why did you do it that way?” shows whether you understood the analysis or followed a tutorial. For [behavioral questions](https://jobbie.bot/blog/behavioral-interview-questions), shape each story with the [STAR method](https://jobbie.bot/blog/star-interview-method).

## Frequently asked questions

### What SQL questions are asked in a data analyst interview?

Expect questions on joins, grouping and aggregation, the difference between `WHERE` and `HAVING`, counting with nulls, removing duplicates, date calculations and window functions such as ranking within a group or running totals. You may have to write queries live, so practice without autocomplete and explain each step aloud.

### How do you prepare for a data analyst interview with no experience?

Build one or two projects on public data that answer a real question, and be able to explain every choice in them. Practice SQL on a small database until joins, grouping and window functions feel routine. Review basic statistics, and rehearse aloud, because your reasoning is part of what is assessed.

### How should you handle a take-home assignment?

Ask how long the employer expects it to take, then stay close to that. State your assumptions at the top, check the data before you analyze it, and lead with the answer to the question that was asked. Keep the write-up short, and say what you would do with more time.

## Sources

- [PostgreSQL Documentation: SELECT](https://www.postgresql.org/docs/current/sql-select.html): how a left outer join treats unmatched rows, and how `HAVING` differs from `WHERE`.
- [PostgreSQL Documentation: Window Functions](https://www.postgresql.org/docs/current/tutorial-window.html): what window functions do, where they are allowed, and filtering on them in an outer query.
- [PostgreSQL Documentation: Aggregate Functions](https://www.postgresql.org/docs/current/functions-aggregate.html): how `count`, `sum` and `avg` treat null values.
- [NIST/SEMATECH e-Handbook of Statistical Methods: Critical values and p values](https://www.itl.nist.gov/div898/handbook/prc/section1/prc131.htm): the definition of a p-value.
- [American Statistical Association: ASA Releases Statement on Statistical Significance and P-Values](https://www.amstat.org/asa/files/pdfs/p-valuestatement.pdf): that a p-value does not measure the probability that a hypothesis is true, or the size of an effect.
