Exactly. I think it is reasonable to ask candidates to demonstrate basic programming competency, but "gotcha" questions are terrible.
Consider the interview question: "Write a function that can detect a cycle in a linked list."
> Between 1955 and 1967, the problem of “how do we determine if there is a cycle in a linked list without modifying the list or using an extra memory” was a essentially an open problem. Meaning, any number of PhD candidates in Mathematics or Computer Science could have written about it as part of their dissertation. With all of those hundreds and hundreds of minds, this problem remained open for 12 years.
> Do you honestly think you could, in a twenty minute interview, from scratch, come up with the solution to a problem that remained open in the field for 12 years, all under a pressure far more intense than any academic? Seems pretty damn unlikely, the only reason you think you could do so is that you’ve heard the answer before, and it seems obvious and simple in retrospect. In other words, “a-ha!”
While I agree that this is an example of a particularly ridiculous interview problem, and "gotcha" type interview problems are bad in general, I don't think it's accurate to say it was an open problem for 12 years. An open problem is one that has been posed but unsolved. In this case, the invention of the linked-list data structure in 1955 does not mean anyone had actually posed the problem of cycle-finding. It's possible, even probable, that the problem hadn't been seriously considered until Floyd did so and came up with the algorithm he published in 1967.
Consider the interview question: "Write a function that can detect a cycle in a linked list."
> Between 1955 and 1967, the problem of “how do we determine if there is a cycle in a linked list without modifying the list or using an extra memory” was a essentially an open problem. Meaning, any number of PhD candidates in Mathematics or Computer Science could have written about it as part of their dissertation. With all of those hundreds and hundreds of minds, this problem remained open for 12 years.
> Do you honestly think you could, in a twenty minute interview, from scratch, come up with the solution to a problem that remained open in the field for 12 years, all under a pressure far more intense than any academic? Seems pretty damn unlikely, the only reason you think you could do so is that you’ve heard the answer before, and it seems obvious and simple in retrospect. In other words, “a-ha!”
https://www.nomachetejuggling.com/2014/06/24/the-worst-progr...