The Path Inward
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L4
Problem
A service config nests sections inside sections, and `config` holds one such tree. Given `path`, a list of keys naming a single setting's route from the top level inward, return that setting's value. Return `None` the moment the path can no longer be followed, including when it runs into a plain value before the keys run out.
Summary
Every setting hides a few levels down. Follow the route, or come back empty.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.