Deloitte interview question

Oops concepts