Cognizant Interview Question

Code for factorial, swapping, descending order, the difference between class and interface?