Microsoft Interview Question

Design an algorithm which produces all the permutations of a given string.