News for hackers. Stuff that matters.
Re:How to Interview Engineers by barrkel on Monday June 26, 2017 @08:14PM (#14641534)
It's actually a tricky problem to think clearly about unless you start enumerating the cases, or get pen and paper out to draw some boxes. I don't think it's completely trivial to verbalise. But I also don't think a competent programmer should fail to work it out.

I like the problem, and I'll probably use it in future :) It'll be a low bar for those times where you're getting the impression that a bigger task will be beyond the candidate, and you want to cut your losses early.

FWIW, I've seen similar complete failures to reason when applied to the even simpler problem of testing to see if a point is inside a rectangle. Some people seem to have a very underdeveloped one dimensional measure function in their brains.

Re:How to Interview Engineers by Stratoscope on Monday June 26, 2017 @10:07PM (#14642059)
It may be easier to verbalize than we think. I just realized that for me the trick might be to not be too abstract and formal when first thinking it out, but look at it more like an everyday problem.

Instead of this:

"Given two appointments, one that starts at time A and ends at time B and another that starts at time C and ends at time D, how can I tell if they conflict?"

More like this:

"I need to run another errand while I'm in town for the interview. I can either do it after the interview, or if I do it first, I'd better be done before the interview."

That gives me something concrete to think about so I can make sure I am on the right track and won't miss my interview! And from there it's a pretty easy path to working out the detailed formula. If I jump into the abstract description right away I'm a lot more likely to confuse myself.

Re:How to Interview Engineers by loup-vaillant on Tuesday June 27, 2017 @11:42AM (#14646430)
Funny; for me, the abstract version is exactly what I need. And the answer pops out almost immediately:

  B <= C or D <= A
(Assuming A <= B and C <= D, for which I may ask the interviewer about.)