Pergunta de entrevista da empresa PayPal

Recursive programming question in react.