3 ms·
Some basic level of programming and problem solving test is reasonable. What I find unreasonable - and which I am currently experiencing - are tests where the
by blunte 7y ago
Some basic level of programming and problem solving test is reasonable. What I find unreasonable - and which I am currently experiencing - are tests where the description is so convoluted or poor that the challenge becomes understanding the problem... not solving it.
All that said, I think you better measure a programmer/developer by asking some questions. Knowing syntax is the last step. But knowing how to break a problem up and which approaches to take in solving it, especially if there are constraints stated, is far more interesting. It's basically like asking the programmer to describe the program they would write.
Let's say the problem is, "Find the first 1000 prime numbers." The solution is less than 10 lines of code in most languages, but there's plenty to talk about.
I(nterviewer): How would you approach this problem?
C(andidate): Can I use the "prime" Ruby gem?
I: Well, it's good that you know it exists, but let's assume you can't.
C: I first need to define a function that, given a number, will return if the number
is a prime.
C: Then I need to loop 1000 times, checking each successive integer (starting from
1) with the is_prime?() function. If it's prime, I print it.
C: Then I increment to the next integer and return to the top of the loop.
I: How did you determine if the number was prime?
C: The simple approach is just to loop from 2 to n-1 (the number we are checking), testing to find out if the number is evenly divisible by the loop index. If it is evenly divisible, then it is not prime. Otherwise, it is prime.
I: Great. What if I asked for the first million primes? Is there anything you would do differently?
C: I would improve the is_prime? algorithm. Blah blah blah, go from 2 to n/2 (or is it square root of n?) Etc. And if that was still too slow, I would research efficient prime algorithms and implement one.
This will tell you if someone can program - even if they have never typed on a keyboard. Programming isn't about typing, it's about being able to define the steps needed to solve a problem.