Amdocs interview question

Related with data structure and javascript