Nasdaq interview question

Basic OOP.