Skip to content

Python Interview Questions for Data Analyst

3 Python questions with answers for data analyst roles. Tick what you have solved to track your progress.

Sheet progressStart practicing
01

How do you deal with missing or duplicate data?

Show answer
Profile the data, remove exact duplicates using keys, impute missing values (mean/median/mode or a business rule), flag imputed rows and document every cleaning step.
02

Show a Pandas groupby example.

Show answer
df.groupby('region')['sales'].agg(['sum', 'mean', 'count']) # splits by region, aggregates, combines the results
03

How do you detect outliers?

Show answer
Visually with a box plot, with the IQR rule (below Q1 − 1.5×IQR or above Q3 + 1.5×IQR) or a z-score above 3. Then decide with the business whether to cap, remove or keep them.