They also teach things like this in boot camps now. The graduates are trained to game these tests because placement rates are so important to boot camps.
Assuming someone is a good programmer because of trivial examples like reversing a binary tree or, worse, writing a bubble sort is like asking someone you to use a wrench to prove that you're an architect.