Hacker News new | ask | show | jobs
by sofuture 5677 days ago
You know, at one point I thought that as well. I felt, that as someone who programs almost solely in 1) C# 2) Erlang -- "thanks I've got a stdlib for that".

And then I actually thought about what it takes to reverse a linked list for a second.

And immediately realized I will never, ever hire someone who can't regurgitate or reason how to reverse a linked list "from scratch" within a few minutes.

5 comments

I'd go one further - if I thought somebody was giving me a rote answer for how to reverse a linked list, I would push them to see if they actually understand why it works. Or switch to something a bit more exotic, like a skiplist or radix trie, and see if they have any intuition about data structures.

It's a linked list, people.

I just went through this exact same process reading your comment. "Well, DSA was a couple years ago... I don't know if I could answer that right off the bat." "Come to think of it, how would I answer that?" "Oh, it's completely obvious."

Not that I expect to be in a position to make hiring decisions, but if someone can't answer that intuitively with a few moments' thought I know they're probably a couple of years' experience from being able to keep up with me.

I did this once in assembly and ended up with a ton of desserts. (push pops)
To play the devil's advocate, and I am speaking specifically within the context of web development, what is a practical example of a linked list?
1) That's irrelevant. I'm speaking to the importance of the ability to reason a linked list which is not really related to 'practical examples of linked lists in a web development context'. To quote silentbicycle above: "It's a linked list, people." We're not talking about 'the latest developments in red-black tree algorithms'.

However... 2) Probably every list of objects you throw around in whatever abstraction providing framework you're using.

Would you hire somebody who can't compute 2+4? For the same reason you wouldn't hire somebody who can't reverse a linked list, even if the actual reversing of the linked list doesn't come up in the job.
Write a webcrawler that doesn't get stuck crawling in circles. You need to maintain history somehow.
Why a linked list? Wouldn't something resembling a hash table or even a tree be a lot better.

I think with web development a lot of the situations where you would want a linked list are abstracted away. Personally I would be testing people on how they take some kind of design outline and map out how they would approach it. Something like dealing with bringing together multiple API's to would be high on the list, this is becoming a much bigger part of web development.

If someone can't understand a linked list, hash tables and trees are well beyond them.
One example,

Given a list of things, implement drag-and-drop way to reorder things.

But on a whiteboard? That they then take a photograph of? Please! Let me pull out my computer and I'll TDD it for you right there. I coded doubly-linked lists in assembly language at age 15 without ever reading about them, but I can't spew it out onto a whiteboard.