LivePerson interview question

Recursion and iterative problems in JavaScript