His first question is very straightforward if you've ever encountered permutations in a math class (and you should have, if you're a programmer). Even if you haven't, it shouldn't be that difficult.
His second is trickier, but solvable. And, no, I've never seen that (particular) question before.
His second is trickier, but solvable. And, no, I've never seen that (particular) question before.