Answer:
The answer is 7 socks.
Explanation:
To ensure one matching pair, you need to pull out 4 socks. If none of the first three match, the fourth one will guarantee a matching pair.
You will then need to pull out 3 more socks, for a total of 7 socks, to ensure two matching pairs.