Meta Interview Question

a recursive problem in js