Hacker News new | ask | show | jobs
by victorhn 3482 days ago
Genuine question, but what is so difficult about reversing a linked list? I don't have the algorithm memorized, but i can deduce in 10 minutes at most.
2 comments

It's not, at all, but it took me by surprise and I made a mess of it. In hindsight the answer was less than 10 lines of python. The next time I went round an interview loop I rote learned all the CS101 stuff, because that's what you have to do (I'm not a computer scientist).

The issue was that the comp contained a lot of stuff that you couldn't deduce in 10 minutes. For example, all-shortest-paths graph search, performing huge calculations (e.g. stuff that blows up extremely fast), monte carlo simulations and other bits and pieces. It would have made for a much more interesting interview.

Not everyone can come up with an answer under a pressure situation when put on the spot. I've managed it in an interview but it was quite stressful.