Python and Pandas interview questions
100 Data Analyst practice questions. Read what a strong answer covers, then practise it out loud against the clock.
Practise Python and Pandas questionsBeginner
- A merge produced more rows than expected
- apply vs vectorised operations
- Cleaning and combining name columns
- Combining DataFrames with concat
- Creating new columns
- CSV file loads into one column or garbled text
- Customers who purchased in the last 30 days
- Data types and converting them
- describe and info
- Exporting results from pandas
- Exporting several tables to one Excel file
- Filtering rows with boolean conditions
- groupby basics
- Handling missing values in pandas
- Jupyter notebooks for analysis
- loc vs iloc
- Many missing values in an age column
- Merging DataFrames
- Monthly revenue from a transactions table
- Notebook is slow because of loops
- Numbers stored as text with symbols
- NumPy basics for analysts
- Pivot tables in pandas
- Plotting with matplotlib and seaborn
- Reading data into pandas
- Removing duplicate records
- Series vs DataFrame
- SettingWithCopyWarning appears
- Sorting and ranking data
- String methods with .str
- Top five products per category
- Using value_counts for exploration
- Why analysts use Python
- Working with dates in pandas
Intermediate
- A date column with mixed formats
- Analysing an A/B test in Python
- Automating a weekly report with Python
- Building a cohort retention table in pandas
- Confusing duplicate column names after a merge
- Converting timestamps between time zones
- CSV file too large for memory
- Filling missing dates in a daily series
- Flagging outliers within each group
- Matching company names across two datasets
- merge_asof for time-based joins
- Method chaining in pandas
- Month-over-month growth for each product
- Moving notebook code into functions and modules
- MultiIndex in pandas
- Parsing a JSON column in pandas
- Polars and DuckDB as pandas alternatives
- Preparing a pivot for a dashboard
- Pulling data from a paginated API
- Querying databases from Python
- Ranking within groups with ties
- Reducing memory usage in pandas
- Reproducible Python environments
- Resampling time series data
- Reshaping data with melt and pivot
- Rolling windows, expanding windows and shift
- Sessionising event data in pandas
- Seven-day rolling average per store
- Statistical analysis libraries in Python
- Testing data analysis code
- The categorical data type
- transform vs agg vs apply in groupby
- Vectorisation with NumPy for complex logic
Experienced
- A notebook gives different results each time
- Adding data quality checks to a Python pipeline
- Analysing 50 GB of logs on a laptop
- Analysing open-text survey comments in Python
- Bootstrapping confidence intervals efficiently
- Building a forecast for planning in Python
- Building a reusable analysis library for the team
- Building an interactive tool for stakeholders
- Building simple data apps with Streamlit
- Code review for analytics code
- Data validation libraries
- Deduplicating customer records at scale
- Detecting anomalies in daily metrics with Python
- Efficient groupby on high-cardinality keys
- Encoding categorical variables for analysis and models
- Finding a subtle bug in analysis code during review
- Geospatial analysis of store catchment areas
- Lazy evaluation in Polars
- Making analyses fully reproducible
- MemoryError when merging two large DataFrames
- Migrating an Excel-based process to Python
- Moving complex logic between SQL and pandas
- pandas 2.x: Arrow backend and copy-on-write
- Parallel and distributed processing in Python
- Parsing semi-structured log files
- Productionising notebook analyses
- Profiling slow pandas code
- Running and interpreting a regression in statsmodels
- Running scheduled Python reports reliably
- Sharing analysis without exposing personal data
- Speeding up a two-hour pandas pipeline
- Survival analysis of customer churn in Python
- Why use Parquet files