LinkedIn interview question

Compute union, intersection