Ctrl K
Data Analyst · Senior · Theory

You have a pandas script that processes a 20 GB CSV file, and it runs out of memory on a machine with 32 GB of RAM. What would you do?

~4 min by voice

How to approach it

The interviewer wants to see whether you understand why pandas inflates data in memory and whether you can solve the problem systematically: measure first, then cut the volume (columns, types, chunks), then change the format or the tool to fit the task, rather than just asking for more hardware.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics
Similar questionsThere are two pandas DataFrames: orders with columns order_id, user_id, and amount, and users with columns user_id and country. Write a function revenue_by_country that takes both DataFrames and returns a DataFrame with the country, the number of unique buyers, and the total revenue, sorted by revenue in descending order. JuniorYou have a pandas script that processes a table of several million rows; it takes half an hour and sometimes runs out of memory. How would you speed it up? Mid-levelHow do you find and handle missing values in pandas? Junior

Answer by voice

The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.

Sign in to answer

Best with headphones · ~4 min