XYZ interview question

find unique element, recursion, database queries .