Similar concept. You have them do some task like fizzbuzz to see if they can program stuff on the fly that they would never need to do in real life. You practice that since school doesn't prepare you for that unless you do ACM programming contests or something. The interview demands this to see if the candidate is capable of cramming for the interview, which correlates with the effort, ability they could put into the job, not with what the skills they actually apply on the job, which are hard to measure in a one hour interview slot anyways.
I agree that some random leetcode-hard problem is not a good indicator, but if you can’t write fizzbuzz or can’t sum an array of integers, you’ve given me important data about your skills as a programmer on that day.
If someone doesn't know how to reverse words in a sentence they are absolutely not qualified to be a programmer. Yes they probably won't do this exact task often, but this is like a doctor that can't distinguish heart from the liver. It tells you something has gone horribly wrong.