Amdocs interview question

thinking process explain the things I did