Loading...
Coalesce Fields
A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- easy
Problem
Our config loader uses a two-layer override pattern: a primary dict where some values may be None, and a defaults dict with fallbacks. Return a merged dict where any None in the primary is replaced by the corresponding value from defaults. Keys present only in defaults should also be included.
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.