Genpact interview question

Multiple Coding questions based on Java