Hitachi Vantara interview question

Interviewer asked 2 coding questions, and basic oops concept