Capgemini interview question

1. Basic coding