As a computer scientist I was thinking what I could do? sorting (according to size/color/...) of course came into mind to achieve O(NlogN) solution.
Hashing or other not in-place solutions are not an option, because I am not able to duplicate my socks, (though it could be nice if I could).
So, the question is basically:
Given a pile of n pairs of socks, containing 2n elements (assume each sock has exactly one matching pair), what is the best way to pair them up efficiently with up to logarithmic extra space (I believe I can remember that amount of info if needed)
Interesting and fun question which is of course closed by stackoverflow.