Re:Why I won't do coding tests
by dropit_sphere on Monday April 04, 2016 @07:56AM
(#11421141)
Make sure you ask for the O(1) solution, because if someone's production instincts are to write
(fn [l h]
(* (dec (- h l))
(/ (+ h l) 2)))
whenever they need to sum between two numbers, then I'd argue they're a worse programmer than someone who just writes `(reduce + (range (inc l) h))`. Programmer time is expensive, and linear time is, for 99% of ranges most devs will encounter, just fine.That is very much dependent on the circumstances. Besides, this is pre-interview weeding question, and if they give the O(1) answer, that gives use something to talk about in the interview.
Re:Why I won't do coding tests
by curryhowardiso on Monday April 04, 2016 @07:46AM
(#11421082)
If and when people ask me this (exact) question I like to tell them that although I can implement the O(1) solution, I just copied it off of a 14 year old.
Seperates those who remember their math from those who don't! Brilliant. I love the Gauss equation for this (had to look it up, I need to review math more).
It's surprising how many timewasters even a simple test like that can weed out.