Learning basic data structures & algorithms is an immensely useful thing for a programmer, and completely essential in many cases. The best of these puzzles are based on problems which people have had to solve in the real world. For the companies, there are many benefits to conducting algorithms interviews:
- setting a minimum standard to make sure there is a shared language and knowledge that you can expect any engineer in company to know.
- making sure you are able to do more than trivial optimisation and go beyond the abstractions that libraries / frameworks provide
- giving you a simple problem to solve in 30 minutes to see if you can program at all.