InterviewStack.io LogoInterviewStack.io

Pandas Data Manipulation and Analysis Questions

Data manipulation and analysis using the Pandas library: reading data from CSV or SQL sources, selecting and filtering rows and columns, boolean indexing, iloc and loc usage, groupby aggregations, merging and concatenating DataFrames, handling missing values with dropna and fillna, applying transformations via apply and vectorized operations, reshaping with pivot and melt, and performance considerations for large DataFrames. Includes converting SQL style logic into Pandas workflows for exploratory data analysis and feature engineering.

MediumTechnical
53 practiced
Show an example of composing a pandas ETL pipeline using method chaining and .pipe for readability and testability. Include steps: read from CSV, filter rows, impute missing values, create features, and write out partitioned parquet. Explain how you would unit-test each independent function used in the pipeline.
EasyTechnical
68 practiced
As a data engineer, how would you estimate a DataFrame's memory footprint? Show pandas code using df.info(memory_usage='deep') and df.memory_usage(deep=True), and demonstrate converting object columns to 'category' with an example before-and-after memory comparison. When are categoricals not appropriate?
EasyTechnical
74 practiced
Given a DataFrame df with columns ['user_id','age','country','signup_date'], write pandas code to filter rows where country == 'US' and age is between 18 and 35. Provide two approaches: (a) boolean indexing and (b) using DataFrame.query(). Show how to bind external variables into query and mention pros/cons of each approach for readability and performance.
HardTechnical
63 practiced
Write pandas code to join billing.csv and accounting.csv on ['invoice_id'] to produce a reconciliation report containing: matched rows, billing-only rows, accounting-only rows, and rows with amount discrepancies greater than $0.01. Use merge(..., indicator=True) and show how to compute summary metrics and export detailed discrepancies to partitioned Parquet for downstream review.
EasyTechnical
72 practiced
Describe how to read a very large CSV file (tens of GB) that cannot fit into memory using pandas. Provide a code sketch using pd.read_csv with chunksize to compute a streaming aggregate, such as total sales per user_id, and then write the results incrementally to disk or S3 in partitioned Parquet format.

Unlock Full Question Bank

Get access to hundreds of Pandas Data Manipulation and Analysis interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.