Same thought process the technical hiring process is convoluted and messy. Forced to learn all sorts of data structures and algorithms that rarely get used in day to day work. It seems that it is more to test you and see if you have revised some solutions. While some of that knowledge is of use I don't think it should be a deciding factor on whether you get the job or not. You could loose out to someone who just happened to memorise some code solution that they don't truly understand themselves.
I will admit that I have been doing some code challenges for practice because almost every interview seems to require you to do them. Of course in an ideal world my work experience, social media presence and projects should be enough.