I'm lead dev for a startup in nyc, we're growing fast and interviewing a lot of candidates. It amazes me how many devs I interview who can't do a sorting algorithm. I'm not talking n log n, just a simple n^2 algorithm. This leads me to my question, does the ability to create a sorting algorithm on the spot show how good you are as a dev. I think it does.
No, it doesn't. I understand the need to sort out good developers from bad developers, but when this exam-style interview scourge finally dies out, it won't be soon enough.<p>All you're doing is optimizing for developers who can create sorting algorithms. If you're a company that specializes in developing new, groundbreaking sorting algorithms, that might make sense. But if you're a company that specializes in, say, B2B software, it doesn't make any sense at all. If one of your developers needs to sort something, they'll just use whatever's available in the libraries or frameworks or languages your company uses.<p>It might be good to see if they understand the differences between n^2 and an n log n algorithms, only because you want to see if they understand the basic concepts of performance in algorithms versus performance in code.<p>Why not ask applicants to submit examples of projects they've done or code they've written, pick a few that look interesting to you, find portions of the code or projects that look especially interesting, and ask the candidates about it? You'll get to see what kind of work they do in general, and asking them about their code should weed out the few cheeky bastards that submitted something they didn't actually write.
When's the last time you had to write a sort? Especially if you work in a scripting language like Ruby, Perl, or PHP -- I developed and now maintain three products that bring in my annual salary x8 or so ... and I couldn't write a sort from scratch.<p>A good developer will Just Get Things Done. Thats a much more valuable skill then having memorized how to write an insertion sort.
If we're talking about any sorting algorithm then I expect a developer to create any sort of algorithm to show that they have some problem solving chops.
I think it does.<p>Any developer should be able to build a simple bubble sort with one hand tied behind his back. It doesn't matter that they've never had to do it before because a bubble sort is pretty obvious.<p>If someone can't throw a simple sort together in a few minutes -- what hope is there that they'll be able to do work worth paying for?