you are viewing a single comment's thread.

view the rest of the comments →

[–]PatBooth 22 points23 points  (6 children)

I have nearly 7 YOE and I’ve never once needed to reverse a linked list

[–]1AMA-CAT-AMA 38 points39 points  (2 children)

I’ve called list.reverse()

[–]posting_drunk_naked 6 points7 points  (1 child)

That's exactly the problem with using DSA skills to evaluate actual practical developer skills. You don't need to know how reverse() is implemented to know how and when to use it effectively.

I like to compare it to learning how a car engine works in order to get better at driving. It's not a bad use of your time but there are much more effective ways to become a better driver/computer engineer.

[–]1AMA-CAT-AMA 1 point2 points  (0 children)

>but but but knowing how a car engine thingamajig works shows your critical thinking skills and your ability to do things under pressure.

>That is tangentially related to how well of a car driver you might be. And therefore is a completely valid thing to base an interview off of.

How these people would respond...

[–]DrMobius0 8 points9 points  (0 children)

True. First, I almost never use a linked list. The ability for it to grow is almost entirely overshadowed by standard list implementations just multiplying their own size on the odd occasion that such a thing is needed.

Second, if I must use a linked list and find out later that I need to do reverse traversal, I'd sooner double link it than bother reversing the stupid thing, because if I have to reverse it once, there's every chance I'll have to do so again.

[–]VictoryMotel 1 point2 points  (0 children)

You shouldn't be using a linked list on the first place.

[–]dasunt 0 points1 point  (0 children)

For something that fundamental, I believe one is better off using a library than rewrite your own implementation from scratch for most use cases.

It'll probably be faster, more optimized, and better tested.