MAQ Software Interview Question

Write a code in your preferred language to get all the permutations of given array