Data analyst interview questions: 28 questions with answer outlines
SQL, Excel, statistics, practical, behavioral and situational questions for data analyst roles, each with what the interviewer looks for and how to structure a strong answer.
Last updated 22 October 2026
What do data analyst interviews test?
Data analyst interviews test whether you can get correct numbers and explain them: SQL joins, aggregation, window functions and NULL handling, spreadsheets and pivot tables, basic statistics and A/B tests, data cleaning and dashboards. Expect a SQL exercise, a case about a metric that moved, and behavioral questions about stakeholders and mistakes.
What are the top 28 data analyst interview questions?
Every question below is listed here with its type and level, then answered in full in the sections that follow. Select a question to jump to its answer outline.
Which SQL, Excel and statistics questions come up most?
SQL answers follow standard SQL behavior; where dialects differ (for example QUALIFY), the outline says so. Write and run each query yourself on a small sample table before the interview.
1. What is the difference between WHERE and HAVING, and where does GROUP BY fit?
Level: Entry. What the interviewer looks for: The logical order of query processing and why aggregates cannot be used in WHERE.
How to answer:
- WHERE filters individual rows before grouping; GROUP BY then forms groups; HAVING filters groups after aggregation.
- So
WHERE SUM(amount) > 100is an error, whileHAVING SUM(amount) > 100works. - Filter rows in WHERE whenever possible: it reduces the data that has to be grouped.
2. Explain INNER, LEFT and FULL OUTER joins. What happens to unmatched rows in each?
Level: Entry. What the interviewer looks for: Correct handling of unmatched rows and awareness of row multiplication.
How to answer:
- INNER JOIN keeps only rows with a match on both sides.
- LEFT JOIN keeps every row from the left table, with NULLs in the right table’s columns when there is no match.
- FULL OUTER JOIN keeps unmatched rows from both sides.
- If the join key is not unique on one side, rows multiply; check row counts before and after joining.
3. Why can a filter on the right table in the WHERE clause turn a LEFT JOIN into an inner join?
Level: Mid. What the interviewer looks for: Understanding that WHERE runs after the join and removes the NULL-extended rows.
How to answer:
- Unmatched left rows have NULL in the right table’s columns; a condition like
WHERE o.status = 'paid'is not true for NULL, so those rows are dropped. - Move the condition into the ON clause (
LEFT JOIN orders o ON o.customer_id = c.id AND o.status = 'paid') to keep all left rows. - Use
WHERE o.id IS NULLdeliberately when you want only the unmatched rows (an anti-join).
4. How does SQL treat NULL in comparisons and aggregates?
Level: Mid. What the interviewer looks for: Three-valued logic and the practical traps it causes.
How to answer:
- NULL means unknown:
NULL = NULLis not true, so useIS NULLandIS NOT NULL. COUNT(*)counts rows;COUNT(column)skips NULLs; SUM, AVG, MIN and MAX ignore NULLs, so AVG divides by non-NULL values only.NOT IN (subquery)returns no rows if the subquery contains a NULL; preferNOT EXISTS.- Use
COALESCEto substitute a default, but only when that default is truly correct for the analysis.
5. What is a window function? How is it different from GROUP BY?
Level: Mid. What the interviewer looks for: Window functions keep each row while computing across a set of rows.
How to answer:
- GROUP BY collapses rows into one per group; a window function computes over a related set of rows but returns a value on every row.
- Syntax:
function() OVER (PARTITION BY ... ORDER BY ...), for example a running totalSUM(amount) OVER (PARTITION BY customer_id ORDER BY order_date). - Window functions are evaluated after WHERE, GROUP BY and HAVING, so to filter on one use a subquery or CTE (some dialects offer QUALIFY).
6. What is the difference between ROW_NUMBER, RANK and DENSE_RANK?
Level: Mid. What the interviewer looks for: Exact behavior on ties.
How to answer:
- ROW_NUMBER gives unique sequential numbers even for ties (tie order is arbitrary unless the ORDER BY breaks it).
- RANK gives ties the same rank and leaves gaps after them (1, 1, 3).
- DENSE_RANK gives ties the same rank without gaps (1, 1, 2).
- Typical use: ROW_NUMBER to pick the latest record per customer; DENSE_RANK for “top 3 distinct values”.
7. How would you find and remove duplicate rows in a table?
Level: Entry. What the interviewer looks for: Defining what counts as a duplicate first, then a reliable query.
How to answer:
- Agree which columns define a duplicate (all columns, or a business key such as email).
- Find them with
GROUP BY key HAVING COUNT(*) > 1. - To keep one per key, number rows with
ROW_NUMBER() OVER (PARTITION BY key ORDER BY updated_at DESC)and keep row 1. - Investigate why duplicates appeared upstream so they do not return.
8. Write the logic to find each department’s second-highest salary.
Level: Mid. What the interviewer looks for: Handling ties and departments with only one salary.
How to answer:
- Rank salaries with
DENSE_RANK() OVER (PARTITION BY department ORDER BY salary DESC)in a CTE, then select rank 2. - DENSE_RANK treats tied top salaries as one value, so the result is the second distinct salary.
- Departments with one distinct salary return no row; say whether that should show as NULL with a LEFT JOIN to the department list.
9. When do you use a CTE instead of a subquery?
Level: Entry. What the interviewer looks for: Readability and reuse, with a nod to performance being engine-specific.
How to answer:
- A CTE (
WITH name AS (...)) names a step, making multi-step logic readable top to bottom. - It can be referenced more than once in the query and supports recursion for hierarchies.
- Performance depends on the engine; check the query plan rather than assuming one is faster.
10. How do you use pivot tables and lookups in Excel or Google Sheets?
Level: Entry. What the interviewer looks for: Practical fluency, including the VLOOKUP exact-match trap.
How to answer:
- Pivot tables summarize data by dragging fields into rows, columns, values and filters; refresh after the source changes and keep the source as a clean table.
- XLOOKUP (Excel 2021 and later, and Microsoft 365) defaults to exact match and can look left; VLOOKUP defaults to approximate match, so pass FALSE as the last argument for exact match.
- INDEX with MATCH works in older versions; wrap lookups to handle missing values explicitly.
11. When is the median a better summary than the mean?
Level: Entry. What the interviewer looks for: Skew and outliers, with a business example.
How to answer:
- The mean is pulled by outliers and skew; the median is the middle value and is robust to them.
- For skewed data such as income, order value or delivery time, the median better describes a typical case.
- Report both when they differ a lot, and look at the distribution (histogram, percentiles) rather than one number.
12. Two metrics move together. How do you explain correlation versus causation to a stakeholder?
Level: Entry. What the interviewer looks for: Naming confounders and reverse causality, and knowing what evidence supports a causal claim.
How to answer:
- Correlation shows the two move together; it does not show one causes the other.
- Alternatives: a third factor drives both (seasonality, marketing spend), causation runs the other way, or it is chance.
- A randomized experiment is the strongest evidence; otherwise state the finding as an association and its limits.
13. What does a p-value of 0.03 mean?
Level: Mid. What the interviewer looks for: A correct definition, avoiding the common misreadings.
How to answer:
- If there were truly no effect, a result at least this extreme would occur about 3% of the time.
- It is not the probability that the null hypothesis is true, nor the probability the result is a fluke.
- It says nothing about effect size; a tiny, unimportant difference can be significant with a large sample.
14. A SQL query runs slowly. What do you check?
Level: Mid. What the interviewer looks for: Reading the plan and reducing data scanned.
How to answer:
- Look at the execution plan for full scans, large sorts and row explosions from joins.
- Filter early, select only needed columns, and avoid functions on indexed or partitioned columns in WHERE.
- On warehouses, use partition and clustering keys and avoid SELECT * on wide tables.
What practical analysis questions should you expect?
These test how you work with real, messy data and real business questions: cleaning, metrics, dashboards and experiments.
15. How would you set up and read an A/B test for a new checkout button?
Level: Mid. What the interviewer looks for: Pre-registration of metric and sample size, randomization, and correct interpretation of results.
How to answer:
- Define the hypothesis, one primary metric (for example checkout conversion) and guardrail metrics before starting.
- Randomize users, not sessions, and calculate the sample size needed for the smallest effect worth detecting.
- Run to the planned sample size instead of stopping when the result first looks significant.
- Report the effect size with a confidence interval and consider practical, not just statistical, significance.
16. You receive a messy dataset. What are your first cleaning steps?
Level: Entry. What the interviewer looks for: A systematic checklist and documenting decisions.
How to answer:
- Profile it: row counts, data types, missing values, distinct values, ranges and duplicates.
- Fix types and formats (dates, currencies, text casing and spaces), and standardize categories.
- Decide how to handle missing values and outliers based on why they exist, and document each decision.
- Reconcile totals against a trusted source before analysis.
17. How do you decide what to do with missing values?
Level: Mid. What the interviewer looks for: Asking why data is missing before choosing to drop or fill.
How to answer:
- Find out why values are missing: a tracking bug, an optional field, or a meaningful absence.
- Options: leave them and report, drop rows if few and random, fill with a sensible value, or flag them in a separate column.
- Check whether results change materially under different choices and state the assumption.
18. How do you design a dashboard that people actually use?
Level: Mid. What the interviewer looks for: Starting from decisions and audience, with clear metric definitions.
How to answer:
- Start with who uses it and which decisions it supports; pick a few KPIs that drive those decisions.
- Define each metric precisely (source, filters, time zone) and show it in a glossary.
- Put the most important numbers top left, show trends and comparisons, and choose chart types that fit the data.
- Check usage after launch and retire charts nobody looks at.
19. Daily active users dropped 15% yesterday. How do you investigate?
Level: Mid. What the interviewer looks for: Checking data quality first, then segmenting systematically.
How to answer:
- Confirm the drop is real: pipeline delays, tracking changes, a release that broke events, time-zone cut-offs.
- Check external factors: holidays, outages, seasonality, marketing changes.
- Segment by platform, app version, country, channel and new versus returning users to locate the drop.
- Share findings early with the confidence level and next steps.
20. A manager asks you to measure “customer engagement”. How do you turn that into a metric?
Level: Mid. What the interviewer looks for: Clarifying the goal and proposing measurable, hard-to-game definitions.
How to answer:
- Ask what decision the metric will inform and what “engaged” behavior looks like for this product.
- Propose a few candidates (for example weekly active users doing a key action, sessions per user, retention) with their trade-offs.
- Agree one definition, write it down and validate that it moves with outcomes the business cares about.
Which behavioral questions do data analysts get?
Answer with a real example in the STAR shape: situation, task, action, result. Interviewers listen for business impact and clear communication.
21. Tell me about an analysis you did that changed a decision.
Level: Mid. What the interviewer looks for: Business impact and clear communication, not just technique.
How to answer:
- Situation: the decision on the table and what was assumed.
- Action: the data you used, the analysis and how you presented it.
- Result: what changed and how you know, stated honestly.
22. Describe a time you found a mistake in a report you had already shared.
Level: Entry. What the interviewer looks for: Honesty, speed of correction and process improvement.
How to answer:
- What the mistake was and how you found it.
- How quickly you told the recipients, with the corrected figures and the impact.
- The check you added so it does not happen again.
23. Give an example of explaining a technical finding to a non-technical audience.
Level: Entry. What the interviewer looks for: Leading with the answer and adapting to the audience.
How to answer:
- The audience and what they needed to decide.
- How you led with the conclusion, used one clear chart and plain language, and handled uncertainty.
- Their response and the follow-up.
24. Tell me about a time you had more data requests than you could handle.
Level: Mid. What the interviewer looks for: Prioritizing by impact and setting expectations.
How to answer:
- The volume of requests and who they came from.
- How you prioritized (business impact, deadlines), agreed it with your manager and told requesters when to expect results.
- Any self-serve fix, such as a dashboard, that reduced repeat requests.
How should you answer situational data analyst questions?
These are hypothetical. Say what you would clarify first, how you would check the data, and how you would communicate the result.
25. A stakeholder wants you to present a number in a way you think is misleading. What do you do?
Level: Mid. What the interviewer looks for: Integrity handled diplomatically, with alternatives.
How to answer:
- Understand the point they want to make and why.
- Explain privately why the framing misleads (for example a truncated axis or a cherry-picked period) and offer an accurate alternative that still tells their story.
- If they insist, escalate to your manager rather than publish something you cannot defend.
26. Two teams report different revenue numbers for the same month. How do you resolve it?
Level: Mid. What the interviewer looks for: Methodical reconciliation and a shared definition going forward.
How to answer:
- Compare definitions: gross versus net, refunds, currency, time zone, booking versus payment date.
- Reconcile step by step from a common source until the difference is explained.
- Agree a single definition with finance and document it in a shared metric glossary.
27. Three days into a planned two-week A/B test, the product manager wants to stop because the variant looks better. What do you say?
Level: Mid. What the interviewer looks for: Explaining the peeking problem and novelty effects without being dogmatic.
How to answer:
- Repeatedly checking and stopping at the first significant result inflates false positives.
- Early results also miss weekly cycles and novelty effects.
- Recommend running to the planned size; if speed matters, plan a sequential testing method in advance next time.
28. You get a request: “Can you pull some data on churn?” What do you do next?
Level: Entry. What the interviewer looks for: Clarifying the question and the decision behind the request before querying.
How to answer:
- Ask what decision the data is for, the definition of churn, time period and segments of interest.
- Confirm the output format and deadline.
- Share a quick first cut to check you are on the right track before polishing.
How should you prepare for a data analyst interview?
| When | What to do | Why it helps |
|---|---|---|
| 1 week before | Practice SQL daily on a sample dataset: joins, GROUP BY with HAVING, window functions and NULL edge cases. Build one pivot table and one small dashboard, and refresh mean versus median, correlation and A/B test basics. | Live SQL rounds reward speed and accuracy that only come from writing queries yourself. |
| 1 week before | Prepare four or five STAR stories: an analysis that changed a decision, a mistake you corrected, explaining data to a non-technical audience, juggling requests. | One well-prepared story can answer several behavioral questions. |
| 1 day before | Re-read the job ad and the company’s product. Think of three metrics the team probably tracks and how you would define them. Check your setup if the interview is remote. | Metric and case questions are easier when you have already thought about the business. |
| During the interview | Clarify the question and definitions before writing SQL, check row counts after joins, state assumptions, and lead your explanation with the answer before the method. | Interviewers score accuracy and communication, not just whether the query runs. |
Where can you practice these data analyst questions?
Use the free mock interview practice tool, already set to data analyst, to answer timed questions and score yourself against a rubric for structure, relevance and depth. To build your own set of questions by level and type, open the interview question generator for data analysts.
How can Perimattic AI Interview help you prepare?
Perimattic AI Interview runs conversational mock interviews by role and level, with spoken or typed answers and feedback on each answer against a rubric for structure, relevance and depth. Hiring teams can run structured first-round interviews with the same questions for every candidate, with recorded answers and transcripts for human reviewers. People, not the AI, make hiring decisions.
Get started: Sign up and our team will walk you through Perimattic AI Interview for the way you prepare for or run interviews.
More interview questions
Data analyst interviews, answered
How much SQL do I need for a data analyst interview?
Be comfortable writing joins, GROUP BY with HAVING, subqueries and CTEs, CASE expressions, date functions and window functions such as ROW_NUMBER and running totals, and know how NULLs behave. Many interviews include a live or take-home SQL task, so practice writing queries without autocomplete and checking row counts as you go.
Do data analyst interviews need Python or R?
It depends on the role. Many analyst jobs center on SQL, spreadsheets and a BI tool, while others ask for Python (pandas) or R for cleaning and analysis. Read the job ad: if it lists Python or R, expect a short exercise in it; if not, strong SQL and clear communication usually matter more.
How should I answer salary questions in a data analyst interview?
This page does not quote salary figures, because analyst pay varies widely by city, industry and the tools a role uses. Research current ranges for the role and location from recent job postings and salary surveys, give a range rather than a single number, and tie it to the skills the role needs.
Want to rehearse data analyst interviews out loud?
Sign up to tell us how you prepare for or run interviews, and our team will get in touch to walk you through Perimattic AI Interview.
Sign up