There have been some posts recently that lament the way that companies hire front-end developers, and in particular "Computer Science questions". I feel like throwing my hat in the ring on this one, because I have some thoughts.
An algorithm, as many of us know, is an ordered list of steps, and the ability to break down a task into steps is a key skill for a programmer of any level.
OK, but why would you ask me to write Quicksort? #
The real problem is not algorithmic design questions per se, but "Computer Science" algorithmic questions, e.g. "build a binary tree" or "write Quicksort". The objection seems to be that these are irrelevant to front-end development, i.e. you will never find yourself doing or dealing with any of this on the web. You'll spend your time wiring up events, dealing with browser issues or CSS being unhelpful (for a change). A few years ago I would have agreed with this point of view, but now I disagree.
The complex problems we face building apps will, in some cases at least, be eerily similar to “classic” Computer Science problems.
Let me ask you this: are apps more or less complex than they were 5 years ago? The answer is, it seems, that they are more complex. They are often more complicated as well. This leads me to think that we are going to find (and are already finding) that the problems we face building apps can be eerily similar to "classic" Computer Science problems. It makes sense, then, to understand these problems, as well as the best-known solutions and data structures. Not that you should need to memorize a given solution, but you should know how it solves the problem so that you can either apply a similar strategy to your own code, or know which API or library you need and why. This empowers you to avoid reinventing the wheel and to make better choices.
In order to entirely disregard Computer Science, then, you really need to be sure that you have no use for it. We saw "print on the web" die and we have moved from simple scripts to building apps. In the same way we are soon going to see expectations of our knowledge and abilities escalate, and it'd be good to be ready for that. We will be building (if we aren't already) very complicated and complex applications, meaning we will need to understand our code design decisions. And most of the time that walks us right into Computer Science.
Confirmation Bias #
In the interests of full disclosure, I should say that I have a Computer Science degree. Am I simply just defending my own experience as the only valid one? No, because I'm not saying you can't be a good developer without first learning Computer Science. That's not what I think. Many developers for whom I have the highest respect have no formal CS training at all. What they do tend to have is a good brain and a desire to learn. In many cases they arrive at very sound CS-like solutions to coding problems, because they perceive the complexity of what they're asking the computer to do.
In any case the fact that someone can arrive at good solutions doesn't negate the benefits of actually learning Computer Science and understanding the best-known solutions to various classes of problems. They will show up in your apps eventually, if they haven't already.
Computer Science represents problem spaces very neatly and gives a language for us to discuss complex and complicated problems. Since web development is tending in that direction, that seems like something we should embrace. In fact, that's exactly why I think companies are asking those Computer Science questions.