LinkedIn Interview Question

How to generate all possible combinations given a list