Ask HN: Does solving math problems make you a good programmer?
My question revolves around the problems that companies like Facebook put on their websites that require programmers to solve puzzles - which are essentially wordy math problems - when submitting an application.
Does this prove you are a great programmer if you can solve the problem? What is the real point?
Note: I am a UI designer with a passive interest in real development and I am simply curious what good coders think.
6 comments
[ 2.3 ms ] story [ 21.7 ms ] threadSimilarly, if you test for math ability in interviews, you will get better candidates, on average, than if you don't. But you aren't guaranteed a great candidate, and you'll like miss a few people that are qualified but just don't do well with those sort of problems. And it's not as reliable an indicator as having written lots of code in interesting problem domains, but the number of people who are hacker-famous is less than the size of most large companies.
The problems that companies like Facebook put on their websites tend to be at least somewhat difficult - probably because they're dealing with rather non-trivial system design problems, and want to make sure you think in a way that will help them solve them, and don't want to limit themselves to the "I have x and y degrees" crowd.
Interviewers should find out how well candidates might work in teams, how familiar they are with debugging on a computer, and how likely it is their "cleverness" won't result in a steaming pile of unmaintainable code. There are lots of reasons why someone may make it or not make it through a puzzle, and either way they may be an excellent candidate.
What should occur is a reasonable bridge between abstract problem-solving and programming, to see if the candidate's aptitudes are strong where it counts. For example, numerical analysis is great: you could ask someone how they would make a machine perform a certain calculation expressed in "pure" math. (Does everyone know how to factor equations to minimize expensive instructions? Do all candidates realize the inherent quirks in things like the representation of floating-point numbers? This is the kind of stuff that comes up when math meets computers.)
compare j=n*(n+1)/2 to for i in range(n+1): j+=i
the former being math and the latter programming for solving summation from 0 to n