Q) How would you write code to reverse a linked list
Anoniem
This was a bit tricky. I explained to the interviewer my visualisation of the linked list and worked my way through the process. Something like: curr = head; while(curr!=NULL){ next=curr->next; curr->next=prev; curr=next } finally, i think i missed assigning the head value as prev at the end.