Data Analytics Interview Questions and Answers
27 questions with short, clear answers · Updated December 2026
Data analyst interviews usually test four things: SQL, a spreadsheet tool, a BI tool such as Power BI, and how you think about numbers and business problems. Python and statistics come up more and more. These questions cover each area, with case questions at the end that test how you would approach a real problem.
SQL carries the most weight in most analyst interviews, so practise writing queries, not just reading answers.
SQL
Q1. Explain the different types of SQL joins.
INNER JOIN returns rows that match in both tables. LEFT JOIN returns all rows from the left table plus matches from the right, with NULLs where there is no match; RIGHT JOIN is the reverse. FULL OUTER JOIN returns all rows from both. CROSS JOIN returns every combination. A self join joins a table to itself, for example employees to their managers.
Q2. What is the difference between WHERE and HAVING?
WHERE filters individual rows before grouping and cannot use aggregate functions. HAVING filters groups after GROUP BY and can use aggregates, for example SELECT city, COUNT(*) FROM customers GROUP BY city HAVING COUNT(*) > 100.
Q3. In what order is a SQL query logically processed?
FROM and JOINs, then WHERE, GROUP BY, HAVING, SELECT (including window functions), DISTINCT, ORDER BY and finally LIMIT or TOP. This explains why a column alias defined in SELECT cannot be used in WHERE but can be used in ORDER BY.
Q4. What are window functions? Explain ROW_NUMBER, RANK and DENSE_RANK.
Window functions calculate across a set of related rows without collapsing them into one row, using OVER (PARTITION BY ... ORDER BY ...). ROW_NUMBER gives unique numbers 1, 2, 3; RANK gives ties the same rank and skips the next (1, 1, 3); DENSE_RANK gives ties the same rank without gaps (1, 1, 2). Others include SUM() OVER for running totals and LAG/LEAD to compare with the previous or next row.
Q5. How do you find the second highest salary?
With a window function: SELECT salary FROM (SELECT salary, DENSE_RANK() OVER (ORDER BY salary DESC) AS rnk FROM employees) t WHERE rnk = 2. Or SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees). DENSE_RANK handles ties correctly and extends easily to the Nth highest or the highest per department with PARTITION BY.
Q6. How do you find duplicate records?
Group by the columns that define a duplicate and keep groups with more than one row: SELECT email, COUNT(*) FROM customers GROUP BY email HAVING COUNT(*) > 1. To delete duplicates but keep one, number the rows with ROW_NUMBER() OVER (PARTITION BY email ORDER BY id) and remove rows where the number is above 1.
Q7. What is a CTE, and when would you use one?
A common table expression (WITH name AS (SELECT ...)) is a named temporary result used within one query. It makes complex queries readable by breaking them into steps, can be referenced more than once, and a recursive CTE can walk hierarchies such as an organisation chart.
Q8. How do NULLs behave in SQL?
NULL means unknown, so any comparison with NULL (even NULL = NULL) is unknown, not true; use IS NULL or IS NOT NULL. COUNT(*) counts all rows but COUNT(column) skips NULLs, and AVG ignores NULLs. COALESCE(column, 0) replaces NULLs with a default. NOT IN with a subquery that returns a NULL returns no rows, a common trap.
Excel
Q9. What is the difference between VLOOKUP, INDEX-MATCH and XLOOKUP?
VLOOKUP looks up a value in the first column of a range and returns a column to the right by number; it breaks when columns are inserted and cannot look left. INDEX-MATCH can look in any direction and is robust to column changes. XLOOKUP, available in current Excel versions, does both in one function, defaults to exact match, and handles not-found values and searching from the end.
Q10. What are pivot tables used for?
A pivot table summarises large data quickly by dragging fields into rows, columns, values and filters, for example total sales by region and month, with grouping, percentages and drill-down. Pivot charts and slicers turn them into a simple interactive report, and Power Pivot handles larger, related tables.
Q11. How do you clean data in Excel?
Remove duplicates, use TRIM and CLEAN for extra spaces and hidden characters, fix text that should be numbers or dates, split columns with Text to Columns or TEXTSPLIT, standardise values with Find and Replace or lookups, and highlight problems with conditional formatting. For repeated cleaning, Power Query records the steps so they can be refreshed with new data.
Q12. What is the difference between relative, absolute and mixed cell references?
A relative reference (A1) changes when the formula is copied; an absolute reference ($A$1) stays fixed, for example a tax-rate cell; a mixed reference ($A1 or A$1) fixes only the column or the row, which is useful in tables such as multiplication grids. Press F4 to cycle through them.
Power BI
Q13. What are the main parts of Power BI?
Power BI Desktop to build reports: Power Query to get and transform data, the data model with relationships, DAX for calculations, and visuals. The Power BI service (online, now part of Microsoft Fabric) to publish, share, schedule refreshes, build dashboards and apply row-level security. Power BI Mobile to view reports on phones.
Q14. What is a star schema, and why does Power BI prefer it?
A star schema has a central fact table of events or transactions (sales amounts, quantities, dates, keys) linked to dimension tables that describe them (product, customer, date, store). Power BI's engine filters and aggregates star schemas efficiently, DAX is simpler, and the model is easier to understand than one flat table or a tangle of relationships.
Q15. What is the difference between a calculated column and a measure?
A calculated column is computed row by row when data is refreshed and stored in the model, so it uses memory and can be used in slicers and axes. A measure is computed at query time for the current filter context, for example Total Sales = SUM(Sales[Amount]), and changes with every filter and visual. Prefer measures for aggregations.
Q16. What does CALCULATE do in DAX?
CALCULATE evaluates an expression in a modified filter context: it can add, replace or remove filters, for example CALCULATE([Total Sales], Product[Category] = "Laptops") or CALCULATE([Total Sales], ALL(Region)) for a grand total. It is the basis of most useful DAX, including time intelligence such as TOTALYTD and SAMEPERIODLASTYEAR.
Q17. What is row-level security?
Row-level security restricts which rows each user sees in the same report: you define roles with DAX filters (for example Region = "North", or a dynamic filter using USERPRINCIPALNAME()), and assign users or groups to roles in the Power BI service. One report then serves every regional manager with only their own data.
Python, pandas and statistics
Q18. How do you handle missing values in pandas?
Find them with df.isna().sum(). Then, depending on why they are missing and how many there are: drop rows or columns (dropna), fill with a constant, the mean or median (fillna), forward-fill time series (ffill), or flag them in a new column. Always check whether "missing" carries meaning, for example a blank discount meaning no discount.
Q19. What do groupby and merge do in pandas?
groupby splits data into groups, applies a function and combines the result, like SQL GROUP BY: df.groupby("region")["sales"].agg(["sum", "mean"]). merge joins two DataFrames on key columns like SQL joins, with how="inner", "left", "right" or "outer"; concat stacks DataFrames on top of or next to each other.
Q20. What is the difference between mean, median and mode, and when do you use the median?
The mean is the average, the median the middle value when sorted, and the mode the most frequent value. The median is better for skewed data with outliers, such as salaries or house prices, where a few very large values pull the mean up. Reporting both often tells the full story.
Q21. How do you detect outliers?
Plot the data first (box plot, histogram, scatter plot). Common rules are values beyond 1.5 times the interquartile range below Q1 or above Q3, or more than about 3 standard deviations from the mean for roughly normal data. Then investigate before removing them: an outlier may be a data error or the most important event in the data.
Q22. What is the difference between correlation and causation?
Correlation means two variables move together; causation means one actually causes the other. Ice cream sales and drowning deaths are correlated because both rise in summer, not because one causes the other. Proving causation needs a controlled experiment, such as an A/B test, or careful causal analysis.
Q23. Explain A/B testing and the p-value.
An A/B test randomly splits users between the current version (A) and a change (B) and compares a metric such as conversion rate. The p-value is the probability of seeing a difference at least this large if there were really no difference; below a threshold set in advance (often 0.05) the result is called statistically significant. Decide the sample size before starting and do not stop the test early when it looks good.
Case and behavioural questions
Q24. Sales dropped 20% last month. How would you investigate?
First confirm the drop is real: check the data pipeline, definitions and whether last month had fewer days or a holiday. Then break it down by region, product, channel and customer segment to find where it happened, and split it into number of orders versus average order value. Check for known causes (price changes, stock-outs, a site outage, competitor activity, seasonality) and present the finding with a recommendation.
Q25. How do you make sure your analysis is correct?
Check row counts and totals against the source after every join and filter, look for duplicates and NULLs, sanity-check results against known numbers (last month's report, finance totals), test edge cases, document assumptions, and ask a colleague to review important queries. Being able to say how you validated a number builds trust.
Q26. How do you explain a finding to a non-technical manager?
Start with the answer and what it means for the business, then the two or three numbers that support it, shown in one clear chart, then the recommendation and any caveats. Avoid jargon and method details unless asked. A good structure is: what happened, why it matters, what we should do.
Q27. Which KPIs would you track for an e-commerce business?
Revenue, number of orders, average order value, conversion rate (orders divided by sessions), customer acquisition cost, repeat purchase rate and customer lifetime value, cart abandonment rate, return rate, and gross margin. Choose a few that tie directly to the business goal, and define each one precisely so everyone calculates it the same way.
Learn Data Analytics hands-on
Knowing the answers is half the job; interviewers also ask what you have built. Technical Guftgu's Data Analytics training is taught in Hindi with live classes, labs and project work, plus resume and mock-interview help. We do not promise or guarantee job placement.
Data Analytics training near you
- Data Analytics training in Gurugram
- Data Analytics training in Dehradun
- Data Analytics training in Bangalore
- Data Analytics training in Hyderabad
- Data Analytics training in Pune
- Data Analytics training in Mumbai
- Data Analytics training in Chennai
- Data Analytics training in Kolkata
- Data Analytics training in Jaipur
- Data Analytics training in Lucknow