I've been programming for 40 years, 35 of that professionally. I've built my own compilers and entire game engines and I don't think I could pass a programming test for a job interview these days. We never gave programming test for RtMI, we just talked about programming with the candidate and never got a bum hire.
These tests might be thought of not as answering "can they code," more about revealing "can they functionally tolerate an obnoxious environment."
Arguably, the "need" for tests is a positive correlate with "lousy management."
Some outfits go out of their way to make things obnoxious starting at the very beginning of the relationship.