Think of it as a slightly less insulting form of FizzBuzz.
I regularily used a similar exercise to weed out bad candidates. The task was to build a stack with based on a double linked. Looking up stuff was okay, but straight copy paste was not. I gave them half a day and told them to write the best code they can.
There where many discussions how that exercise is relevant to the junior PHP dev position we were hiring for (spoiler: it's not). But it gives you a good idea what the candidate considers good code (consistent code style, documentation, tests,...)