Carta SWE Interview Question 2023 March | Linked Lists

Question · Posted Jun 2026

Question 1: Remove Nth Node From End of List Problem Statement Given the head of a linked list, remove the n-th node from the end of the list and return its head. Can you do it in one pass? Constraints The number of nodes in the list is sz 1 <= sz <= 30 0 <= Node.val <= 100 1 <= n <= sz Examples Example 1: Input: head = [1, 2, 3, 4, 5], n = 2 Output: [1, ...

The full answer & interview discussion are available to premium members.

Log in Create a free account