Cognizant interview question

How to define our own exception class