PwC interview question

Just some basic coding problems