The Change Data Capture
A hard Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- hard
- Seniority
- L5
Problem
Given old_snapshot, new_snapshot (lists of dicts keyed by id_field), return a dict with four sorted lists: 'added' (records in new only), 'removed' (in old only), 'unchanged' (identical across both), 'modified' (same id, different other fields). Sort each list by id_field ascending.
Summary
Inserts, updates, deletes : all present.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.