Cognizant interview question

Basic oops concept and pattern program