LinkedIn interview question

How to generate all possible combinations given a list