D4D Technologies interview question

How would you create a socket from scratch