Nowadays we hire people who already know how to code - I don't have time to teach someone to code. That's why I'm a big fan of github-as-resume. I want you to write code to make my company money so show me your code. But since women choose not to write open source, this form of work-sample test is criticized as discriminatory as well.
Also note that certain large meritocratic institutions (trading desks, some tech firms) do hire more or less on IQ. They can't actually give an IQ test themselves due to Griggs vs Duke Power so they outsource it to elite colleges instead. That's basically what is happening when they say "must come from a top school".
The cultural mythology of Google (and earlier, Microsoft, when they were the ascendant, 800-lb gorilla) was about their puzzle based interviews, and how they didn't care about your specific skill set but only raw intelligence. (We can debate about whether that was the best way to select and hire people, but I don't think there's much dispute that this was something these companies did.)
It's probably worth noting that the companies that used the brain teasers and IQ-proxy tests also did a "cultural fit interview" - basically, trying to answer honestly the question "would I be cool with spending 8 hours a day working with this person, or would I be seeking ways to kill myself?"
That specifically is illegal in the United States.
Corporations are forced to use proxies instead, such as SAT or ACT scores, or things keyed to that, like college admissions.
In the US, doing that is a decent way to get sued.
'tokenadult has a standard comment (he's made it many times with various revisions/updates) on this topic that you should read: https://news.ycombinator.com/item?id=6584957