Microsoft interview question

Recursively reverse a singly linked list.

Interview Answers

Anonymous

19 Nov 2009

Just gave this a shot. void reverse(Node node, Node previous){ Node next = node->next; node->next = previous; //point to previous node if(next != null) { reverse(next, node); } }

Anonymous

1 Oct 2011

My fav :)

Anonymous

25 May 2019

Stand up and walk backwards out of the interview room.

Anonymous

21 Mar 2009

The difficulty was not so much in the question but in the on the spot nature without much time.