NIIT Limited interview question

oops concepts