Earlier quoted context omitted.
He's a developer, not a telepath. In tests like this you make it clear what's allowed - "use the standard library, no external dependencies" etc. Because in a normal working situation, his solution is perfectly valid. If I were interviewing him it certainly wouldn't be a dealbreaker. I'd probably want to discuss more about pros and cons of in-house vs using libraries, because you tend to find out more about the skill…
In an interview you are trying to show that you understand the problem. Not just get the right answer.
Maybe in company A they are looking for developers who come up with a solution on their own and don't rely on external libraries or Google. Maybe company B don't like developers reinventing wheels and prefer they at least research prior art first.
I don't know what kind of culture your company has, but at the very least out of courtesy you can signal what the requirements are in your test.