Python data engineering interview problem. Difficulty: intermediate. Pattern: Linked Lists. About 14 minutes. Part of the Pro drill bank.
Merge two sorted value-lists into one sorted list. Treat this as a production helper: match the contracted return shape, including empty and duplicate inputs.
Implement merge_two_lists(a: list, b: list) -> list merging ascending sorted lists (list API).
Input: merge_two_lists([1, 2, 4], [1, 3, 4]) Output: [1, 1, 2, 3, 4, 4] Stable merge of both chains.
Topics: lakebench, python, merge, list api.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Merge two sorted value-lists into one sorted list.
Implement `merge_two_lists(a: list, b: list) -> list` merging ascending sorted lists (list API). Example: `[1, 2, 4], [1, 3, 4]` → `[1, 1, 2, 3, 4, 4]`. Keep the harness.