Data Analyst · interview prep

Data Analyst interview questions and answers (2026)

The Data Analyst questions candidates are most often asked, covering SQL joins and window functions, Excel, Power BI or Tableau, statistics, data cleaning. Each answer is short enough to say out loud. For the full process, scenario and HR questions and a 48-hour plan, open the guide for your company below.

Preparing for a Data Analyst interview? Rehearse these questions with Interview AI Helper: ask any question and get a suggested answer in seconds, written from your own resume.

Free 5-minute demo

Data Analyst interview guides by company

Most asked Data Analyst questions

How do you decide whether to use INNER JOIN or LEFT JOIN in a reporting query?

Use INNER JOIN when you only want rows that exist in both tables, for example valid orders with matching customer records. Use LEFT JOIN when you want all rows from the main table, even if the other table has no match. In reporting, LEFT JOIN is useful when you want to keep all transactions and show missing reference data as NULL. The choice depends on whether missing matches should be excluded or kept for analysis.

From the Accenture Data Analyst guide

How do you write a SQL query to find the top 3 products by revenue in each category?

I would first aggregate revenue by category and product_id, then use ROW_NUMBER() partitioned by category and ordered by total revenue descending. After that, I would filter to rows where the rank is 3 or less. This is better than a plain GROUP BY because I need a top-N result within each category, not one overall list. I would also check tie handling, because business users may want either exactly 3 rows or all tied products.

From the Amazon Data Analyst guide

How do you use COUNT(*), COUNT(column), and COUNT(DISTINCT column) differently in SQL?

COUNT(*) counts every row, including rows with NULL values. COUNT(column) counts only rows where that column is not NULL. COUNT(DISTINCT column) counts unique non NULL values. In reporting, this matters when you want total records, valid responses, or unique customers. A common mistake is using COUNT(column) and expecting it to include missing values.

From the Infosys Data Analyst guide

What is the difference between INNER JOIN, LEFT JOIN, and FULL OUTER JOIN?

An INNER JOIN returns only matching rows from both tables. A LEFT JOIN returns all rows from the left table and matching rows from the right table, with NULL where there is no match. A FULL OUTER JOIN returns all rows from both tables, matching where possible and using NULL for missing matches. I would choose based on whether I need only matched data or also unmatched records for analysis.

From the TCS Data Analyst guide

How would you write a query to find customers who placed orders in the last 30 days but not in the previous month?

Use a subquery or CTE to select distinct customer IDs from the orders table where order_date is between current_date minus interval '30 days' and current_date, then left join to the same table filtered for the period 30‑60 days ago and keep rows where the right side is null. This isolates recent customers without activity in the prior month.

From the Wipro Data Analyst guide

What problem does COALESCE() solve in SQL?

COALESCE() returns the first non-NULL value from a list, so it helps you replace missing values with a default. For example, COALESCE(discount, 0) makes calculations safer when discount is missing. In reporting, it is useful for cleaner output and fewer NULL values in dashboards. I would use it carefully, because replacing missing data with a default is a business choice, not just a technical one.

From the Accenture Data Analyst guide

What is the difference between GROUP BY and window functions?

GROUP BY collapses rows and returns one row per group, so it is useful for totals, averages, and counts. Window functions keep the original rows and add calculated values beside them, such as a running total or rank. I use GROUP BY when I need summary output, and window functions when I need analysis at row level plus context. In reporting, window functions are especially helpful when I need both detail and comparison in one query.

From the Amazon Data Analyst guide

What is the difference between ROW_NUMBER(), RANK(), and DENSE_RANK()?

ROW_NUMBER() gives each row a unique sequence, even if values are tied. RANK() gives the same rank to ties, then skips the next rank number. DENSE_RANK() also gives the same rank to ties, but does not skip numbers. Use ROW_NUMBER() for de duplication or top 1 per group, and use the others when ranking tied values in a report.

From the Infosys Data Analyst guide

When would you use a window function instead of GROUP BY?

Use a window function when you want to calculate something without collapsing rows. For example, SUM(sales) OVER (PARTITION BY region) gives regional total sales for each row, while GROUP BY region returns one row per region. Window functions are useful for running totals, rankings, and comparing each record to its group, while keeping the detailed data visible.

From the TCS Data Analyst guide

Explain how you would use the LAG() window function to compare each day's revenue with the previous day’s revenue.

Select date, revenue, and LAG(revenue) OVER (ORDER BY date) as prev_rev from the sales table. Then compute revenue‑prev_rev as daily_change. LAG returns the value from the preceding row according to the order clause, allowing a direct day‑over‑day comparison without a self‑join.

From the Wipro Data Analyst guide

How would you get the previous month’s sales for each month in SQL?

I would use a window function like LAG() ordered by month. For example, LAG(sales) OVER (ORDER BY month) gives the prior row’s sales, which is useful for month-over-month analysis. If the data is by customer or region, I would add PARTITION BY so the comparison stays within each group. This is better than self-joining when the goal is a simple time-based comparison.

From the Accenture Data Analyst guide

How would you calculate month-over-month growth in SQL?

I would aggregate the metric by month first, then use LAG() to bring in the previous month’s value. After that, I would compute growth as (current_month - previous_month) / previous_month. I would protect against division by zero and missing months. If the dataset has gaps, I may need a calendar table so the comparison is truly month to month. That makes the result more accurate for business reporting.

From the Amazon Data Analyst guide

How would you calculate a rolling 7 day total in SQL?

Use a window function with an ordered date column and a frame clause. For example, SUM(sales) OVER (ORDER BY sale_date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW). This gives the current day plus the previous 6 rows, so it works well when there is one row per day. If dates can be missing, you may need to first create a complete date calendar.

From the Infosys Data Analyst guide

How do you find the second highest salary in SQL?

One common way is to use DENSE_RANK() or ROW_NUMBER() over salary in descending order. For example, SELECT salary FROM (SELECT salary, DENSE_RANK() OVER (ORDER BY salary DESC) AS rnk FROM emp) t WHERE rnk = 2;. DENSE_RANK() is better if duplicate salaries exist and you want the second distinct salary.

From the TCS Data Analyst guide

What steps do you take to normalize a dataset that contains mixed units for the same metric?

Identify the metric and list all unit variations, create a mapping table that defines a conversion factor to a standard unit, then apply a calculated column that multiplies the original value by the factor. Verify the conversion by sampling a few rows and checking totals before and after.

From the Wipro Data Analyst guide

Data Analyst interview coming up?

Practise these Data Analyst questions out loud and get suggested answers in real time, based on your own resume. Free 5-minute demo, no subscription.

Try the free demo
← All interview question guides