So, I gave a few interviewees a code test, and they failed miserably. Mind you, nothing hard - it was a test can I give you a simple function to write, and can you 1) declare a function or class that accepts the right inputs, 3) does what the spec asks, and 3) has the correct output format. The test took 10 minutes to an hour, and was totally open book. The result was pretty staggering. 2/3 of developers would fail the test, and not for esoteric reasons. They would fail because they used the wrong boolean operator, make simple type-casting mistakes, or fail to return data in the correct type (i.e. return a string and instead return a bool or an int). When they failed, it wouldn't be just one thing, it would be two or three mistakes.
So, now I code test everyone, and it has nothing to do with your salary. If we expect you to program in your job, we will verify that you can actually string together 10-15 lines of code. I've only had a handfull of applicants call the test leetcode (I think it's a lot simpler than that), but the reality is there are just a lot of people who can't really code out there.