Oracle Interview Question

I was asked to implement String class in Java. Next question was given a linked list, for every n size groups remove the last k elements. In another round, I was asked to reverse a part of linked list Given an array with duplicates,find all unique permutations of the array