IMO the 'testing' done these days for CS interviews is just a by-product of the "big" "OG" companies starting out with a lot of "top university" grads/students. So when those guys needed to hire new recruits, they wanted a way to screen them that resonated with what they were used to: rigorous testing and exams. So they replicated the kinds of tests they needed to pass to get into Stanford/Ivies/MIT/etc. and the ones they had during coursework and produced the basic idea of what SDE interviews are now.
And since that became the standard from the beginning, it's what remains now.
There are pretty clear differences in what a BS in Computer Science represents from different schools.
1st Tier schools a Bachelor's degree holder has most of the fundamentals of mathematics within computer science. Complexity of algorithms, complexity of operations on various data structures, models of computation, problems that can be solved with different models, etc..
20 years on from going to school it took me a long time to figure out a lot of schools don't cover almost all of that until you're working on a Master's degree or Ph. D. It's really surprising.
I think some of CS questions in interviews are because the degrees are so variable. I don't think this is a problem when you're hiring a Mechanical Engineer or a Civil Engineer who is licensed. All the schools need to teach to a uniform enough standard that their graduates can pass the licensing requirements.
CS is a mess. The Top Tier schools seem like they may be so much better that a Bachelor's degree is worth more than a Master's degree from other places.
Few real world programming problems are straight forward enough to test on. Or at least I don't expect computer science to turn into a physics/chemistry/math level of science.
I think it's hovering around medicine. Where there is a seemingly art form to deal with the realities of our too complex biology.
And since that became the standard from the beginning, it's what remains now.