The Payload Flattener
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L3
Problem
Given a nested dict (keys map to primitive values OR to inner dicts), return a flat dict whose keys are the joined key paths using the given separator. Non-dict values become leaves with the full joined key path.
Summary
Turn a deeply nested API response into a flat row.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.