Loading...
The Nearest Value Mapper
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- senior
Problem
The data team is building an approximate join between two datasets. Sensor readings come in with timestamps that don't line up exactly with the reference table, so each reading needs to match to the closest available reference point. Write a function that maps each element from one list to the nearest element in a second 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.