They asked me to explain how I would optimize a Python script that processes large datasets and occasionally crashes due to memory overflow.
Sigiloso
I explained how I would use generators and lazy loading techniques, as well as optimize data structures like switching from lists to sets or dictionaries depending on the use case. I also mentioned profiling tools to identify memory hotspots.