Well, technically if he isn't getting paid, it's his copyright, allowing him to use the code and even create a business around it, and the company has no rights to it- so in this case it worked out well for him.
But yes, its a pretty crappy idea that people should do 'real' work for free to get hired.
But yes, its a pretty crappy idea that people should do 'real' work for free to get hired.