The Schema Differ
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L4
Problem
Given new_schema and old_schema (each a list of {'name', 'type'} dicts), return a dict with: 'added' (list of column names in new only), 'removed' (list of column names in old only), 'type_changed' (list of {'name', 'new_type', 'old_type'} dicts where the same column name has a different type). Sort 'added' and 'removed' by name ascending, and sort 'type_changed' by 'name' ascending.
Summary
Schema from yesterday vs today. Something changed.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.