Toptal Interview Question

Didn't get this far