Moody's interview question

Solving tower of Hanoi problem using an algorithm