Eternus Solutions interview question

oops concepts