Loading...

Flatten the Nest

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

Domain
Python
Difficulty
easy
Seniority
senior

Problem

Our event ingestion layer receives batches that are sometimes nested one level deep. Write a function called flat_map that takes a list containing integers and single-level nested lists of integers, and flattens it into a single ordered list.

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.