IBM Interview Question

Write a program to fetch all the number sets which sum upto a desired target from an array. 2 sum problem(both optimal and bruteforce)