Some people are good test takers on paper. Ask me to whiteboard some code, and I genuinely get stuck on trivial problems because whiteboarding coding questions is not what I am great at.
I've worked at Amazon and now I am at Google - after alot if stress, anxiety, and prep, I was able to get through and get hired. Microsoft outright rejected me.
One other thing - CS degrees don't teach people to code. They reach computer science. It just so happens that labs and assignments may require coding, but spending half a day or a day to do a project and getting an A has very little relationship with being forced to quickly hash out code in a 45 min interview.
IMO, at both companies I have been at, the majority of new hires are fresh grads. The barrier to entry whose been out of school is extremely high... but I digress.