Python data engineering interview problem. Difficulty: intermediate. Pattern: Linked Lists. About 14 minutes. Part of the Pro drill bank.
Remove the nth node from the end of a value-list. Treat this as a production helper: match the contracted return shape, including empty and duplicate inputs.
Implement remove_nth_from_end(values: list, n: int) -> list.
Input: remove_nth_from_end([1, 2, 3, 4, 5], 2) Output: [1, 2, 3, 5] Remove 4 (2nd from end).
Topics: lakebench, python, two pointers, list api.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Remove the nth node from the end of a value-list.
Implement `remove_nth_from_end(values: list, n: int) -> list`. Example: `[1, 2, 3, 4, 5], 2` → `[1, 2, 3, 5]`. Keep the harness.