4 ms·
Are you asking them to do this in a particular language, or just to come up with an algorithm? This might work better as the sort of problem you ask an intervie
by hcayless 14y ago
Are you asking them to do this in a particular language, or just to come up with an algorithm? This might work better as the sort of problem you ask an interviewee to talk you through, rather than an "I'll check on you in 10 minutes" kind of exercise. But in general, no, this kind of thing isn't out of bounds, and I'd say if 10% of your candidates are passing it, you're in the right sort of neighborhood.
- jlangenauer 14y agoI tell them to do it in any language they're comfortable with, though obviously, if they're interviewing for a Ruby rule, I'd be surprised if they didn't do it in Ruby. I actually do ask them to write the code - I'd expect most programmers to know the basic syntax of the language the claim to be proficient in, but I've seen Ruby developers who are unable to correctly use Array#each, which would be a red flag.
- jlangenauer 14y agoAlso, they don't need to come up with an algorithm: to solve the problem, you simply need to implement exactly what's written in the problem statement - calculating each element based on the previous row, and with a couple of conditional statements (or other ways) to handle the edge cases at the, er, edge of each row. There is a bit of a conceptual leap in working out a recursive solution is possible (as is an iterative one), so I'll sometimes gently drop hints if a candidate seems to be struggling on this point.