Interview practice question
Refactoring a 3,000-line pipeline script
Data Engineering · Python · Experienced
You inherit a single 3,000-line Python script that runs a critical pipeline. Nobody wants to touch it. How do you refactor it safely?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- First capture current behavior with end-to-end output comparisons.
- Add logging and tests around the risky parts.
- Break it into modules step by step: extract, transform, load, config.
- Refactor in small pull requests, verifying outputs each time.
- Keep the pipeline running in production throughout.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.