upvote
> I get a disturbing number of people who say things like "I would communicate with the person asking for this to see what they're really intending blah blah"

Sounds like they know this question is a “gotcha” question but just misinterpreted which direction you were going with it.

Some will ask a question like this expecting you to treat it like a puzzle and outline how you’d solve it as-is; others ask it as a way to probe how you’ll deal with strange or misguided requests (the case you noted as disturbing); and others yet will ask it to see how you’d practically solve it (your intention).

Seems like a bad interview question without context regarding kind of answer you’re looking for.

reply
No, it's a pretty good interview question because it tells me if somebody's instinct is to reinvent the wheel or not. What I didn't expect was how many people couldn't say how a wheel even works.
reply
People are not generally answering interview questions based on instinct, but rather based on what they think the interviewer wants to hear to get the job. I would have interpreted this is as a leetcode style algo question and started by treating it as such, even though IRL my first instinct would be "get a lib that does it". Awful, awful strategy.
reply
It appears that either answer would be accepted, and so I'm fine with it. If it really is there is one correct answer then I'm against this. This feels like a problem where a good enough solution can be done in the time of an interview if you do it by hand (though if anyone knows about dates they will expect there is a lifetime of fixing special cases left if you don't use the library)

I prefer fizz-buzz as a question because it is obvious there isn't a library. It is also a problem you should be able to do in an interview. It has enough weirdness that there is no best answer, despite having several workable paths you could try.

reply
Nope, not remotely awful. I've made great hires from it, which is its point.
reply
Its not. Any interview question where you are looking for a specific answer is already suspect, but especially if you don't properly provide context for the question in what you would expect, things become a shit show.

If you would ask someone to write a piece of code, and a part of the problem is this conversion, then you would be right to expect they reach for a library, but even if they don't you would be giving them the opportunity to explain themselves, and judge the explanation, not the answer. Also, if your test is "does this person reach for a library at the right time", you could do a lot less esoteric and confusing by just asking them to add 10 days to a date. If you just ask this one specific problem, it is likely they assume you are looking for them to demonstrate the skills involved in actually solving the problem, i.e. leetcode.

This is also why some people give you the blabla answer, because it is indeed very unlikely that someone needs to do this legitimately. This is because its a toy problem. Someone's professional reaction to the problem in isolation should indeed be: this is weird, I've never been asked something like this, what's up?

Finally, even though the question is terrible, I would still rate the "whatsup?" response higher than the "leapyear" response. I would want a developer to triple check that this problem needs solving, before they would solve it themselves.

Finally finally, if there's one answer to one question that, when answered trivially in a way literally taught in most basic programming courses (use the standard library / a third party library), makes them a "guaranteed hire", I also have significant doubts about the level of talent you are bringing in, as any experienced interviewer will tell you that qualified people will get important questions wrong, and unqualified people will get important questions right.

I understand that this reaction might be quite harsh, and I know better than anyone that its hard and time consuming to do good interviews, but please consider that you are rejecting people who may be very confused and sad by this way of rejection.

reply
But that's why the context of the question is important. It's not clear from your comment, but I'd give a different answer if the question was strictly academic in nature (reinventing the wheel) or focused on practical work realities (use a library).
reply
Even using a library isn't that practical. It may be the zeitgeist in JavaScript but that doesn't mean it's actually a good idea. Nobody remembers left-pad? If you're writing Java or Python then checking if your date class can already do it is a good idea.
reply
> My favorite answer was on a phone interview where he just hung up and wouldn't answer when we called back.

Heh ... yeah well I wish I had it to do that.

However, you are asking gotcha questions.

reply