In my experience, a lot of companies are combining _all_ these things. So you're expected to do a phone interview, a test project/coding test, a whiteboard test, and the management brown-nosing at the end of it where you get to pitch that you've studied a hard technical skill your whole career just because you're so passionate about getting woken up at 3AM on PagerDuty to build _their_ vision, and definitely not beca…
Walk yourself through that for a second. You're saying a company that's hiring would intentionally make the process difficult for applicants in order to help their competitors retain their employees? That doesn't make sense. Even if they conspired with said competitors for this purpose, they would simply be ceding the hiring advantage to anyone who wasn't conspiring with them.
Occam's razor suggests a simpler answer: it turns out that identifying good software workers is a hard problem.