InterviewStack.io LogoInterviewStack.io

Python for Data Analysis Questions

Covers the practical use of Python and its data libraries to perform data ingestion, cleaning, transformation, analysis, and aggregation. Candidates should be able to manipulate data frames, perform complex grouping and aggregation operations, merge and join multiple data sources, and implement efficient vectorized operations using libraries such as Pandas and NumPy. Expect to write clear, idiomatic Python with appropriate error handling, input validation, and small tests or assertions. At more senior levels, discuss performance trade offs and scalability strategies such as choosing NumPy vectorization versus Pandas, and when to adopt alternative tools like Polars or Dask for very large datasets, as well as techniques for memory management, profiling, and incremental or streaming processing. Also cover reproducibility, serialization formats, and integrating analysis into pipelines.

MediumTechnical
60 practiced
Implement an efficient approach to process a very large CSV (100M+ rows) using pandas chunking: read chunks, perform per-chunk aggregations, and incrementally combine results to produce a final top-10 customers by revenue. Include code that demonstrates using chunksize, groupby per chunk, and combining with accumulate/merge logic.
EasyTechnical
62 practiced
You are building a KPI that ignores incomplete records. Describe and implement basic strategies in Python/pandas to identify and handle missing values in numeric and categorical columns for a reporting table. The function should: (a) summarize missingness by column, (b) impute numeric NULLs with sensible defaults only when appropriate, and (c) flag rows removed due to >50% null columns. Provide code examples and brief justification for choices.
HardTechnical
60 practiced
You're merging two very large tables that don't fit memory for a straightforward pandas.merge. Describe external-memory join strategies and implement, in Python pseudo-code, an external sort-merge join or hash-partitioned join that can run with limited memory. Highlight assumptions, disk IO patterns, and failure modes.
MediumTechnical
63 practiced
You're joining three data sources with slightly different key formats (ints, strings with leading zeros, and padded codes). Write a robust join pipeline in pandas to normalize keys, perform joins, and assert referential integrity for the final dataset used in a dashboard. Also include de-duplication and an explicit plan when referential integrity fails.
MediumTechnical
63 practiced
Compare serialization formats for BI analytics: CSV, JSON, Parquet, Feather, and Avro. For each, discuss compression, schema support, read/write performance in pandas, suitability for columnar analytics, and typical use-cases for storing intermediate analytic artifacts.

Unlock Full Question Bank

Get access to hundreds of Python for Data Analysis interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.