Python data engineering interview problem. Difficulty: beginner. Pattern: Arrays. About 10 minutes. Part of the Pro drill bank.
Find all numbers in 1..n missing from the array. Treat this as a production helper: match the contracted return shape, including empty and duplicate inputs.
Implement find_disappeared(nums: list) -> list for nums of length n with values in 1..n. Return missing numbers sorted.
Input: find_disappeared([4, 3, 2, 7, 8, 2, 3, 1]) Output: [5, 6] 5 and 6 never appear.
Topics: lakebench, python, missing, range.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Find all numbers in 1..n missing from the array.
Implement `find_disappeared(nums: list) -> list` for nums of length n with values in 1..n. Return missing numbers sorted. Example: `[4, 3, 2, 7, 8, 2, 3, 1]` → `[5, 6]`. Keep the harness.