Moving Day
A hard Python interview practice problem on DataDriven. Write and execute real python code with instant feedback.
- Domain
- Python
- Difficulty
- hard
- Seniority
- L5
Problem
A schema migration is an ordered list of operations run against every stored record: `rename` a field, `add` one with a default, `remove` one, or `cast` a field to `int`, `float`, or `str`. A field's `path` is dot-separated so an operation can reach into a nested record like `addr.country`, and `add` builds any intermediate records that are missing while `rename`, `remove`, and `cast` skip a path that isn't there. Casting is lenient: a value that will not convert, such as `None`, is left as it is.
Summary
Old schema in, new schema out.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and checks it automatically.