When I was hiring back in maybe 2020, I used a basic FizzBuzz test. Yep, the FizzBuzz test you've all read about. About half the people (all college grads) who took it could not pass in the allotted hour. Yup, an hour to do FizzBuzz. Whatever language you want. Whatever you want to Google. I'd say 40%-50% could not do it.
A common error was not being able to get the first number evaluated to be 1. They had written(copied) for loops as `for i:=0;i<100;i++` so many times that they couldn't understand that setting i to 1 was all they needed to do. They didn't see the code. Just the "loop line" and it wasn't doing it right. Then it was making it stop at 100 instead of 99. All that before even trying to test mod 5 and mod 3 first.
The people who did pass it would have written it before I'd even finished describing the problem and they would all but sneer (in a professional manner) at the rest of the code "challenges." We made offers to those people and they worked out great.
I've also seen this in coding interviews, but I will also add that when this happens and the line just doesn't work "as it should", a common reaction is to start changing things essentially at random (i.e. without trying to methodically deconstruct what the code does). And sometimes this random approach ends up working in the right direction, but because it requires more than one step to get there, the (correct) first step gets discarded because it didn't immediately produce the correct result.
In general, it feels like many students learn to program by rote memorization of patterns - i.e. they remember that putting those parts in this sequence gives this result, and putting them in a different sequence gives a different result, but they don't know why there is a difference; they just treat them as magic incantations, sort of.
It's kind of like if someone learned to write by memorizing entire words as is without learning the alphabet first. They can recognize or spell any word they already know, but give them a new word and they are completely stumped.
A common error was not being able to get the first number evaluated to be 1. They had written(copied) for loops as `for i:=0;i<100;i++` so many times that they couldn't understand that setting i to 1 was all they needed to do. They didn't see the code. Just the "loop line" and it wasn't doing it right. Then it was making it stop at 100 instead of 99. All that before even trying to test mod 5 and mod 3 first.
The people who did pass it would have written it before I'd even finished describing the problem and they would all but sneer (in a professional manner) at the rest of the code "challenges." We made offers to those people and they worked out great.