Apple interview question

Two sum problem and polymorphism