Loading...

The Dict Comparator

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

Domain
Python
Difficulty
medium
Seniority
junior, mid

Problem

Given two dictionaries, create a new dictionary where the keys are sorted and the values represent only the entries that are present in the first dictionary but differ from (or missing in) the second. Return a dict of keys from dict1 whose values differ from dict2.

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.