Data analyst interview Q&A in PDF
Use these data analyst technical interview questions and answers as a PDF-ready study sheet, with runnable SQL and pandas tasks and checked revenue totals.

These 10 data analyst technical interview questions and answers cover data quality, SQL, pandas, statistics, and reporting in a PDF-ready format. Each question includes a model answer and the signals an interviewer listens for. Save the article as a PDF for revision, then run the two practical tasks to check your calculations against the expected results.
A printable technical revision sheet
Use the sheet to rehearse explanations, then verify the practical answers in PostgreSQL and Python. Open your browser’s Print dialog and choose the PDF destination available on your operating system. Check the preview so each question stays with its answer and evaluation criteria, adjusting scale or margins if necessary.
The central checkpoint is reconciliation: comparing independently calculated totals to explain any difference. Calculate net revenue from individual orders before running either tool, then compare both outputs with that manual total. A static PDF can't execute code or evaluate your spoken reasoning.
Answer aloud before reading each model answer. For hands-on work, The Work Gym has SQL and pandas courses; its Interview Hub supports spoken and typed interview practice with a written report.
When you're ready to rehearse without reading the answers, use Data analyst interview practice.
Data structure and missing values
Reliable calculations start with what each row represents, not with the choice of tool. Establish the grain, meaning the unit represented by one row, and the join cardinality, meaning how many rows can match across tables.
1. "What would you check before combining an orders table with a refunds table?"
Model answer: I'd establish the grain in each table. I'd check whether
an order identifier is unique in orders and whether refunds can contain
several rows for one order. I'd also check missing identifiers,
unmatched refunds, currency, and the reporting period before calculating
revenue.
Interviewer listens for: Row meaning, key checks, relationship
cardinality, and business definitions before code.
2. "When would you replace a missing refund amount with zero?"
Model answer: After joining complete orders to an aggregated refund
table, an absent matching refund can mean no refund, so zero may be
appropriate. A missing amount on an existing refund record is a
different problem and shouldn't automatically become zero. I'd confirm
the source meaning and flag unknown amounts before reporting.
Interviewer listens for: A distinction between no matching record and
an unknown value, rather than blanket missing-value replacement.
Practice what this post teaches
SQL calculations and filter choices
The SQL task tests whether you can preserve one row per order while calculating net revenue. A common table expression, introduced by WITH, names an intermediate result so the aggregation and join are easier to inspect.
3. "Write a PostgreSQL query that returns total net revenue when an order can have several refunds."
Fictional exercise specification:
Use one currency: rupees. Include all three orders and all three refunds.
Orders: (order_id, gross_rupees) = (1, 1000), (2, 600), (3, 400).
Refunds: (order_id, refund_rupees) = (1, 100), (1, 200), (2, 50).
There are no missing amounts or unmatched refund identifiers.
Target: net revenue = gross revenue minus refunds, counting each order once.
Expected calculation: (1000 - 100 - 200) + (600 - 50) + 400 = 1650.
Starting action: run the following statement unchanged in PostgreSQL.
WITH orders(order_id, gross_rupees) AS (
VALUES (1, 1000), (2, 600), (3, 400)
), refunds(order_id, refund_rupees) AS (
VALUES (1, 100), (1, 200), (2, 50)
), refund_totals AS (
SELECT order_id, SUM(refund_rupees) AS refund_rupees
FROM refunds
GROUP BY order_id
)
SELECT SUM(o.gross_rupees - COALESCE(r.refund_rupees, 0))
AS net_revenue_rupees
FROM orders AS o
LEFT JOIN refund_totals AS r USING (order_id);
Expected output:
net_revenue_rupees
1650
Model answer: Aggregate refunds to one row per order before joining.
Keep every order with a left join, and use COALESCE to substitute zero
for an absent refund total.
Interviewer listens for: Correct aggregation grain, preservation of
unrefunded orders, and reconciliation to the expected total.
4. "How do WHERE and HAVING differ when filtering a grouped revenue report?"
Model answer: WHERE filters input rows before grouping. HAVING filters
groups after aggregation. I'd put an order-date restriction in WHERE
and a condition on a grouped revenue total in HAVING. Moving a condition
between the two can change the population and therefore the answer.
Interviewer listens for: Processing order, the distinction between rows
and groups, and awareness that filter placement changes meaning.
Explain the filtering choice in business terms: which orders enter the calculation, and which resulting groups remain visible. Naming the clauses without explaining their effect isn't enough.
Pandas calculations and merge checks
The pandas task reproduces the same revenue definition while checking the merge relationship explicitly. A DataFrame is pandas’ table-like data structure; a merge combines DataFrames using matching keys.
5. "Use pandas to calculate net revenue and verify that each order appears once after the merge."
Fictional exercise specification:
Use Python 3 with pandas installed. All amounts are rupees.
Orders: (order_id, gross_rupees) = (1, 1000), (2, 600), (3, 400).
Refunds: (order_id, refund_rupees) = (1, 100), (1, 200), (2, 50).
There are no missing amounts or unmatched refund identifiers.
Target: preserve three order rows and calculate total net revenue.
Expected calculation: gross 2000 - refunds 350 = net 1650.
Starting action: save the code below as revenue_check.py and run the
file with Python 3 in your editor. No input changes are needed.
import pandas as pd
orders = pd.DataFrame({
"order_id": [1, 2, 3],
"gross_rupees": [1000, 600, 400]
})
refunds = pd.DataFrame({
"order_id": [1, 1, 2],
"refund_rupees": [100, 200, 50]
})
totals = refunds.groupby("order_id", as_index=False)["refund_rupees"].sum()
report = orders.merge(
totals, on="order_id", how="left", validate="one_to_one"
)
report["refund_rupees"] = report["refund_rupees"].fillna(0)
report["net_rupees"] = report["gross_rupees"] - report["refund_rupees"]
assert len(report) == len(orders)
assert report["net_rupees"].sum() == 1650
print(len(report))
print(int(report["net_rupees"].sum()))
Expected output:
3
1650
Model answer: Group refunds before merging, validate the expected
relationship, fill only absent refund totals, and check both row count
and net revenue.
Interviewer listens for: Explicit merge assumptions and executable
checks, not just a plausible final number.
The merge validation rejects nonunique keys in either input to the merge. The assertions are executable checks that stop normal execution when a condition is false. Together, the checks test structure and value; matching totals alone could hide errors that cancel each other out.
6. "A pandas merge produces more rows than the orders table. How would you investigate?"
Model answer: I'd count rows per join key in both inputs and check
whether the relationship matches the intended output grain. Multiple
refunds per order are legitimate, but they require aggregation for a
one-row-per-order report. I'd also inspect missing keys and key types.
I wouldn't remove duplicate rows just to force the expected row count.
Interviewer listens for: Diagnosis before deletion, an understanding of
legitimate repeated keys, and a merge validation rule matched to the
intended relationship.
After checking both runnable solutions, explain the join decisions without looking at the code in Technical interviews practice.
Statistics and experimental judgment
Strong statistical answers connect a method to the business question and its assumptions. Define the measure before choosing a summary, and separate uncertainty about an effect from whether the effect matters.
7. "Would you report the mean or median order value, and why?"
Model answer: I'd first define whether order value means gross or net
value and inspect the distribution. The mean is the total divided by
the order count, but large orders can move it substantially. The median
is the middle value after sorting and is less sensitive to extremes.
I'd often report both, with order count and an explanation of unusual
values.
Interviewer listens for: A clear metric definition, awareness of skew
and outliers, and a reason for the chosen summary.
8. "An experiment shows a higher conversion rate in the treatment group. What would you check before recommending a rollout?"
Model answer: I'd verify the conversion definition, random assignment,
tracking quality, and whether the same user can appear in both groups.
Conversion rate is the share of eligible users taking the target action.
I'd examine effect size, meaning the size of the difference, and its
uncertainty. I'd also check the planned stopping rule and business
safeguards, such as refund rates.
A p-value describes how incompatible the observed result is with a
specified no-effect model, under its assumptions. It isn't the
probability that the no-effect hypothesis is true. I'd distinguish
evidence of an effect from evidence that the effect justifies rollout.
Interviewer listens for: Experimental validity, correct uncertainty
interpretation, practical significance, and caution about repeatedly
checking results and stopping when they look favorable.
Reporting decisions and technical handoff
Treat the checked source calculation as the dashboard’s reference, not merely another number to display.
9. "How would you present the revenue result in Power BI or Tableau, and what would you avoid claiming?"
Model answer: I'd show gross revenue, refunds, and net revenue with
explicit currency, reporting period, and refresh information. I'd make
the calculation definition visible and use a trend chart only when
comparable time data exists. I'd validate the dashboard total against
the checked source calculation. I wouldn't describe net revenue as
profit because the example contains no cost data.
Interviewer listens for: Metric clarity, appropriate visual choices,
reconciliation, and restraint about unsupported business conclusions.
10. "Your dashboard and the finance team's report show different revenue totals. How would you resolve the disagreement?"
Model answer: I'd compare metric definitions, source versions, refresh
times, date boundaries, time zones, and treatment of refunds, tax, and
cancellations. Then I'd reconcile records at a shared grain and explain
the remaining differences by category. I'd agree on the reporting
definition with the relevant owner, document the decision, and add a
repeatable check rather than changing a calculation solely to match
another total.
Interviewer listens for: A systematic reconciliation process,
respectful stakeholder handling, and a durable correction rather than
a cosmetic match.
Before marking an answer ready for revision, check whether your explanation includes all four elements:
- Assumption: what must be true about the records or business definition.
- Method: the calculation or investigation you'd perform.
- Verification: the independent total, relationship check, or evidence you'd inspect.
- Limitation: what the available data or chosen method can't establish.
Use the PDF as a reminder of that reasoning structure, not as a script. Running the tasks and explaining why the checks work gives you evidence that memorizing a final number doesn't.
Common questions
How can I save these questions and answers as a PDF? Open your browser’s Print dialog and select the PDF destination available on your operating system. Preview the pages and adjust scale or margins so questions, model answers, and code aren't clipped.
Which three technical skills should a junior data analyst practice first? Start with SQL aggregation and joins, spreadsheet calculations, and data-quality checks. Practice explaining row meaning, missing values, and reconciliation while working, rather than treating those checks as separate theory.
How should a senior candidate extend these model answers? Add production considerations such as late-arriving refunds, currency conversion, changing source records, and checks that run after every refresh. Explain who owns the metric definition and how you'd investigate and document a discrepancy.
How can I use a PDF question sheet without memorizing answers? Cover each model answer and explain your assumptions, method, verification, and limitation aloud. After running the original tasks, change one source amount, recalculate the expected total, and update the corresponding check before rerunning.