Cognizant interview question

Basic coding on any language