Loading...

The Schema Diff

A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.

Domain
Python
Difficulty
medium
Seniority
mid, senior

Problem

A config management tool needs to compare two dictionaries and classify every difference. Given two dictionaries d1 and d2, return a dictionary with three keys: 'added' (keys only in d2), 'removed' (keys only in d1), and 'changed' (keys in both but with different values - mapped to a tuple of (old, new)).

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a sandboxed Docker environment and grades it instantly.