Loading...
The List Merger
A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- easy
- Seniority
- mid
Problem
Two data pipelines each produce a sorted stream of integer IDs. The downstream consumer needs a single merged stream that is also sorted, but calling sort() on the combined output is not allowed because the data may be too large to fit in memory at once. Write a function that merges two already-sorted lists into one sorted list using only the two-pointer technique.
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.