Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Your technical interview is way too easy....


Indeed, please write an algorithm to reverse a linked list in O(1).


Assuming I can choose linked list implementation, that is trivial:

It's a doubly linked list where the head contains a pointer to the tail, and a flag that determines which pointer in the nodes is forward and which is backward.


It's a trick question. Ask if its on Space or Time complexity ;-)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: