Python interview questions and answers for data analysts, data scientists and data engineers

Python interview questions for data roles are about pandas and data manipulation, not general software trivia. Real questions with worked answers below, across the data roles that get a Python round.

11 Python questions

11. You need to process a 50GB CSV on a machine with 16GB of RAM. How?

Stream it instead of loading it: read_csv with chunksize, or hand it to an engine that spills to disk and reads only the columns you touch (DuckDB, Polars lazy, Spark). If it is a recurring job, convert once to Parquet, columnar plus compression usually cuts both IO and memory by an order of magnitude. The general move is to make the working set fit in memory, not the file.

Practice this for real