Microsoft Interview Question

Write a function that duplicates a singly linked list (each node also has a random reference that points to any of the other nodes).