How useful are algorithm questions in an interview?

I wrote this answer on quora.com.
Hiring a programmer is an incredibly risky process. In less than 5 hours you are supposed to distill the experience, aptitude and team fit of an individual. Even better you’re supposed to project forward how that experience will jive with the uncertain future of the company.

The three most important abilities in a software engineer are

1) An ability to master multiple technologies
2) An ability to communicate effectively on complex topics
3) An ability to work on a team, and by implication do what is necessary for the team to succeed.

An interview that focuses exclusively on algorithms reveals a narrow slice on (1) and a very narrow slice on (2) and it tells you nothing about (3).

But how useful is a strong mastery of algorithms? The short answer is it depends.

For most jobs for most people at most companies…

If we’re talking about the basics, it’s very useful … except that most data structures these days are a hash-map. Knowing other data structures is useful in certain situations but most of the time it’s a little bit of arcana…

If we’re talking about more advanced data structures? Probably not at all. In practice most software systems have very simple algorithms.

For pushing the boundaries of what is possible… And those are rare jobs or rare moments within rare jobs…

It’s actually very useful to have a good and deep understanding of algorithms that apply to your problem space. It’s really useful to be able to read papers and results and understand how they apply to your problem domain. But no one ever asks those in an interview becaue of the absurdity of asking that question…

And there are classes of jobs where it turns out that understanding algorithms is the job. These are not very common jobs. But they exist. However, they are certainly not the average job at the average high-tech company.

In fact what is more useful and rarely asked in interviews is how do you approach learning a new system? Questions about how you learn about software. Probing questions about the depth of your understanding of the systems you understood and how well you understood it…

And then too little time is spent on leadership and how people worked with other people and how they dealt with conflict… And how folks deal with ambiguity etc…

It’s my belief that the fascination with algorithms is a residual side effect of the fact that too many people went to schools where math competitions and computer competitions were ways in which people measured ability.

In practice, it turns out that being good at math olympiads is not well correlated with being a great mathematician… Which makes me think that being great at algorithms is good but not sufficient to be great at your job in software.

At Zynga, where I work when I write this answer, we try and cover all three areas. We have people probe CS fundamentals, design, architecture, and cultural fit.  Having five people ask five different brain teasers is not considered the right way to interview a candidate.

Leave a Reply