PwC interview question

Scenarios to write the code in your language.