A common task in programming interviews (not from my experience of interviews though) is to take a string or an integer and list every possible permutation.
Is there
Here's a high level example I wrote which illustrates the human language explanation Peter gave:
public List FindPermutations(string input)
{
if (input.Length == 1)
return new List { input };
var perms = new List();
foreach (var c in input)
{
var others = input.Remove(input.IndexOf(c), 1);
perms.AddRange(FindPermutations(others).Select(perm => c + perm));
}
return perms;
}