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
0 practiced
You are joining a large fact table (~100M rows) with a small dimension table (~50k rows) in pandas. Describe memory-efficient strategies for performing the join in Python, including dtype alignment, use of categoricals, chunked joins, or offloading to a database. Provide example code snippets where appropriate.
HardTechnical
0 practiced
Implement or sketch Python code using an existing HyperLogLog library to compute approximate distinct user counts per day while processing input in chunks. Show how to update sketches per chunk, persist sketches between runs, and merge sketches to obtain final daily distinct estimates.
MediumTechnical
0 practiced
Outline the steps and tools you would use to profile a slow pandas job to determine whether the bottleneck is CPU, Python-level loops, memory pressure, or I/O. Mention specific profiling tools/libraries and what you would look for in their output.
EasyTechnical
0 practiced
Describe the difference between .loc and .iloc in pandas with code examples that demonstrate label-based vs integer-position based selection, including examples of slicing that show inclusive/exclusive behaviour. Mention common gotchas.
HardTechnical
0 practiced
Nightly cohort retention metrics suddenly change after an upstream schema update. Describe a reproducible investigative process in Python to detect which change caused the metric drift: include data diffing (row counts, checksum of key columns, schema comparison), versioned artifact comparison, and automated reporting to stakeholders.

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.