The answer really is not to play the game.
Unless, as I mentioned, you’re absolutely stuck on a role because you really want to work for a particularly company but they employ ludicrous coding tests then you’re going to have to jump through hoops. One big company springs to mind here, I think they do search and ads, lot of ads.
Or, of course, if you absolutely need work and it’s the only job open to you right now, get ready to jump and ask how high.
My argument is to absolutely refuse them if you feel they’re demeaning, take no account of experience, or are just plain memory challenges. It’s only by refusing and stating why that, perhaps, things will change.
I’m in the same boat myself, decades of experience and I’m asked to capitalise first letters of words in a sentence. Good grief. I’m not a confrontational person at all but I’ve gained the confidence to excuse myself from quite a few interviews now, politely declining the process, and stating why I wished to withdraw.