Roche Interview Question

Q: Given a string, define an algorithm to generate all possibilities of permutation.