Amadeus interview question

Basic oops question