This was an interesting puzzle, but I don’t really know why people continue to entertain these kinds of questions in interviews. To be fair, it’s possible the job required heavy use of algorithms, but as such a high percentage do not, at least not for day-to-day work, it seems kind of ridiculous.
I think developers collectively shoot themselves in the foot when we take part in such ceremonies and reduce the business value we bring to companies.
This quote from the article is truly disgusting to me - “This specific interview significantly hurt the offer I received. Unfortunately, there’s a lot of luck to the interview process as there is a lot of luck in life.” WTF?? The only thing more preposterous than the fact that messing up this problem hurt the offer is that this guy accepted that as his lot in life.
I like Lorin Hochstein’s quote on cycle detection algorithms: “I’m not a fan of expecting interviewees to re-invent the algorithms of famous computer scientists on the spot”.
I’m considering making a hobby out of doing these interviews, heh.