Endava interview question

Basic Swift and OOP questions:)