Microsoft interview question

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