I graduated this spring and I don't know how to do that. Now, I am not a boy genius but I doubt it is a CS fundamental.
It isn't a difficult problem, even having never seen it before. This is one of those warmup problems to test how comfortable a candidate is with basic concepts such as recursion.