Loading...
The Map Reducer
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- junior, mid
Problem
Our analytics pipeline applies transformations in two stages. Write a function called map_reduce that takes a list of values, a mapper function that transforms each value, and a reducer function that combines two values into one. Apply the mapper to every element, then reduce the mapped results left to right. If the list is empty, return None.
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.