The Schema Migrator
A hard Python mock interview question on DataDriven. Practice with AI-powered feedback, real code execution, and a hire/no-hire decision.
- Domain
- Python
- Difficulty
- hard
- Seniority
- L5
Interview Prompt
Given a list of record dicts and a list of operations, apply each operation in order to every record and return the transformed records. Each op is a dict with key 'op' (the operation) and key 'path' (dot-separated for nested fields, e.g. 'addr.country'). Supported ops: 'rename' (also carries 'new_name'), 'add' (also carries 'default' as the value to insert), 'remove' (no extra fields), 'cast' (also carries 'target_type' in 'int' / 'float' / 'str'). For 'add' on a nested path, create missing intermediate dicts. 'rename' / 'remove' / 'cast' on a missing path are no-ops.
Summary
Old schema in, new schema out.
How This Interview Works
- Read the vague prompt (just like a real interview)
- Ask clarifying questions to the AI interviewer
- Write your python solution with real code execution
- Get instant feedback and a hire/no-hire decision