Apple Interview Question

Two sum problem and polymorphism