Amdocs interview question

1 Leetcode question, 3 questions about Objects