TGViewer
Data Analyst Interview Resources Data Analyst Interview Resources @dataanalystinterview ยท 52.6K subscribers
Post #1857 3.28K
โœ… Data Analyst Interview Questions ๐Ÿ“Š

๐ŸŸจ SQL
1๏ธโƒฃ Write a query to find the second highest salary in the employee table.
SELECT MAX(salary) AS second_highest
FROM employee
WHERE salary < (SELECT MAX(salary) FROM employee);

(Handles ties; alternative: use DENSE_RANK() for modern SQL.)

2๏ธโƒฃ Get the top 3 products by revenue from sales table.
SELECT product_id, SUM(revenue) AS total_revenue
FROM sales
GROUP BY product_id
ORDER BY total_revenue DESC
LIMIT 3;


3๏ธโƒฃ Use JOIN to combine customer and order data.
SELECT c.customer_name, o.order_date, o.amount
FROM customers c
INNER JOIN orders o ON c.customer_id = o.customer_id;

(Use INNER for matches; LEFT for all customers.)

4๏ธโƒฃ Difference between WHERE and HAVING?
WHERE filters rows before grouping; HAVING filters after GROUP BY (e.g., on aggregates like SUM). WHERE is for individual rows, HAVING for grouped results.

5๏ธโƒฃ Explain INDEX and how it improves performance.
An INDEX speeds up data retrieval by creating a data structure (like a B-tree) for quick lookups on columns. It reduces full table scans but adds overhead on inserts/updates.

๐ŸŸฆ Excel / Power BI
1๏ธโƒฃ How would you clean messy data in Excel?
Use Text to Columns for splitting, Find & Replace for errors, Remove Duplicates tool, and Power Query for advanced ETL (e.g., trim spaces, handle dates).

2๏ธโƒฃ What is the difference between Pivot Table and Power Pivot?
Pivot Tables summarize data visually; Power Pivot adds data modeling (relationships, DAX) for larger datasets and complex calculations beyond standard Pivots.

3๏ธโƒฃ Explain DAX measures vs calculated columns.
Measures are dynamic formulas (e.g., SUM for totals) computed on-the-fly for reports; calculated columns are static, row-by-row computations stored in the model.

4๏ธโƒฃ How to handle missing values in Power BI?
Use Power Query to replace nulls (e.g., with averages via "Replace Values"), or DAX like IF(ISBLANK()) in visuals. For viz, filter them out or use "Show items with no data."

5๏ธโƒฃ Create a KPI visual comparing actual vs target sales.
In Power BI, drag KPI visual, add actual sales to Value, target to Target, and trend metric. Set variance to show % differenceโ€”green/red indicators highlight performance.

๐ŸŸฉ Python
1๏ธโƒฃ Write a function to remove outliers from a list using IQR.
import numpy as np
def remove_outliers(data):
Q1 = np.percentile(data, 25)
Q3 = np.percentile(data, 75)
IQR = Q3 - Q1
lower = Q1 - 1.5 * IQR
upper = Q3 + 1.5 * IQR
return [x for x in data if lower <= x <= upper]


2๏ธโƒฃ Convert a nested list to a flat list.
nested = [[1, 2], [3, 4]]
flat = [item for sublist in nested for item in sublist]
# Or: import itertools; list(itertools.chain.from_iterable(nested))


3๏ธโƒฃ Read a CSV file and count rows with nulls.
import pandas as pd
df = pd.read_csv('file.csv')
null_counts = df.isnull().sum(axis=1)
print(null_counts[null_counts > 0].count()) # Rows with at least one null


4๏ธโƒฃ How do you handle missing data in pandas?
Use df.fillna(value) for imputation (e.g., mean), df.dropna() to drop rows/cols, or df.interpolate() for time series. Check with df.isnull().sum() first.

5๏ธโƒฃ Explain the difference between loc[] and iloc[].
loc[] uses labels (e.g., df.loc['row_label']) for selection; iloc[] uses integer positions (e.g., df.iloc[0:2])โ€”great for slicing by index.

๐Ÿ’ก Pro Tip: Practice with mock datasets from Kaggle + build dashboards on Power BI to showcase in interviews.

๐Ÿ’ฌ Tap โค๏ธ for detailed answers!
  • โค 4
  • ๐Ÿ‘ 1
More from @dataanalystinterview
  1. Oct 10, 2026๐Ÿ“ข Advertising in this channel You can place an ad via Telegaโ€คio. It takes just a few minuโ€ฆ
  2. Oct 9, 2026โœ…SQL Roadmap: Step-by-Step Guide to Master SQL ๐Ÿง ๐Ÿ’ป Whether you're aiming to be a backendโ€ฆ
  3. Oct 9, 2026๐Ÿ‡ฎ๐Ÿ‡ณ ๐—š๐—ข๐—ฉ๐—˜๐—ฅ๐—ก๐— ๐—˜๐—ก๐—ง ๐—ข๐—™ ๐—œ๐—ก๐——๐—œ๐—” โ€” ๐—”๐—œ๐—–๐—ง๐—˜ ๐—œ๐—ก๐—ง๐—˜๐—ฅ๐—ก๐—ฆ๐—›๐—œ๐—ฃ๐—ฆ ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ ๐Ÿš€โ€ฆ
  4. Oct 8, 2026๐ŸŽ“ ๐— ๐—ถ๐—ฐ๐—ฟ๐—ผ๐˜€๐—ผ๐—ณ๐˜ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—ผ๐˜‚๐—ฟ๐˜€๐—ฒ๐˜€ ๐˜„๐—ถ๐˜๐—ต ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ฒ๐˜€! ๐Ÿš€๐Ÿ”ฅ Upgrโ€ฆ
  5. Oct 7, 2026๐Ÿš€๐—ฃ๐—ฎ๐˜† ๐—”๐—ณ๐˜๐—ฒ๐—ฟ ๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—ง๐—ฟ๐—ฎ๐—ถ๐—ป๐—ถ๐—ป๐—ด | ๐—•๐—ฒ๐—ฐ๐—ผ๐—บ๐—ฒ ๐—ฎ ๐—™๐˜‚๐—น๐—น๐˜€๐˜๐—ฎ๐—ฐโ€ฆ
  6. Oct 7, 2026๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ฃ๐—ผ๐˜„๐—ฒ๐—ฟ ๐—•๐—œ ๐—ณ๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜! ๐Ÿ”ฅ Learn Power BI through these FREE learninโ€ฆ
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’