Citi interview question

Oops concepts