Implement a Linked List class (for ints only) that supports an append function, which simply appends to the end of the list.
After that, they asked me to implement an appendAt function that takes two ints as arguments, and appends the second argument to the node containing the first argument in the list.
e.g for a list 1 -> 2 -> 3 -> 4 -> 5 , appendAt(3,6) would result in a list: 1 -> 2 -> 3 -> 6 -> 4 -> 5
e.g for a list 1 -> 2 -> 2 -> 3 -> 4 -> 5, appendAt(2,8) would result in: 1 - > 2 -> 8 -> 2 -> 3 -> 4 -> 5 (i.e if the first argument appears more than once in the list, then append the second argument to the first instance of the node containing the first argument)
I gave an iterative solution to the problem. The interviewer then asked me to write it recursively.
This one is really easy, I faltered on it for some reason.