Catchpoint interview question

Generate all permutations of a given string