News for hackers. Stuff that matters.
Re:How to Interview Engineers by rpeden on Tuesday June 27, 2017 @08:28AM (#14644748)
A decently clever candidate could sneak out of that first one without a loop. Something like

    numbers.reduce((a,b) => Math.min(a,b))
would do it in JavaScript. In general, if a candidate realizes they can use reduce for that purpose, in my experience interviewing candidates they probably wouldn't have much trouble doing it with a loop, and it would usually be a signal they're going to have a pretty good interview.

Then again, you might run into a joker who has just memorized how to use reduce for finding the maximum or minimum element in a list of numbers.

Re:How to Interview Engineers by WorldMaker on Tuesday June 27, 2017 @11:36AM (#14646364)
I find that's a telling way to determine the experience of the interviewer. I'm saddened by the number of times an interviewer has asked me, "What is a reduce? How does it work?" Of course, that information isn't very helpful in the flow of an interview, it's mostly just upsetting.
Re:How to Interview Engineers by deathanatos on Tuesday June 27, 2017 @12:26PM (#14646823)
As of yet, nobody has used reduce(). If they did, and especially if they followed it with a coherent explanation of what reduce does & how it worked (and convinced me they've not memorized reduce for a singular purpose, but understand it well enough to apply it generally), I'd definitely accept it.

If they can also write, or at least quickly approximate, the for-loop solution too, then I'd say I've gotten an excellent signal: not only can the candidate write a for loop, but he or she might also have some experience with a functional paradigm from somewhere.