Cloudflare interview question

Solve this programming question we have...