Cognizant interview question

Basics of ooos and 1 basic code i.e. swapping