Interview practice question
Comparing two files for differences
Data Engineering · Python · Beginner
You need to find rows that differ between yesterday's and today's extract of a customer file. How do you do it in Python?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Load both files and merge on the primary key.
- Use indicator=True to find added and removed rows.
- Compare columns for matched rows to find changes.
- Or hash each row and compare hashes.
- For large files, use DuckDB with EXCEPT.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.