All the Way Down
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L3
Problem
API responses arrive as dicts nested arbitrarily deep, and the warehouse needs them as single-level rows. Collapse `nested` into a flat dict whose keys are the full path down to each leaf, joined by `separator`, where any value that is not itself a dict is a leaf. An empty inner dict contributes no key, so that branch simply disappears from the result.
Summary
The payload nests without end. The warehouse needs one 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.