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
46 practiced
Implement normalize_timestamps(series, formats=None, default_tz='UTC') in Python that robustly parses a pandas Series containing mixed timestamp representations (strings of various formats, epoch ints, pd.NaT) into a timezone-aware UTC datetime Series. Try user-provided formats first, fall back to pd.to_datetime(errors='coerce'), and log parsing failures for manual inspection.
EasyTechnical
63 practiced
List and explain common techniques to handle missing data in pandas: dropna, fillna, interpolation, forward/backward fill, and model-based imputation. For each technique provide a short code example and discuss scenarios where it is appropriate or risky (e.g., biasing downstream models).
HardSystem Design
47 practiced
Design a monitoring and alerting system for data quality in Python ETL pipelines that detects freshness lag, schema drift, count anomalies, and distribution shifts. Specify metrics to compute (row counts, null rates, column histograms), drift detectors (KL divergence, PSI), alert thresholds and escalation policies, and a remediation playbook. Describe integration points with observability tools like Prometheus, Grafana, and alerting systems.
MediumTechnical
55 practiced
A pandas aggregation that used to run in minutes now requires 20 minutes in production. Outline a systematic plan to profile and optimize it: which tools to use (cProfile, line_profiler, memory_profiler), which metrics to collect (CPU, memory, disk IO), how to identify whether the bottleneck is IO, CPU, or memory, and specific optimization steps (dtype tuning, reducing copies, vectorization, or switching to different tools).
HardSystem Design
56 practiced
Architect a scalable Python-based solution to compute daily and near-real-time aggregates over 1TB of raw JSON logs per day (500+ fields) with dashboards that require updates within 15 minutes. Discuss when to use single-node Pandas/Polars vs distributed systems (Dask, Spark), partitioning strategies, file-format choices (Parquet), shuffle minimization, memory management, and incremental vs streaming approaches. Provide recommended data flow and resource considerations.

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.