Ocrolus Interview Question

Logic questions on HOC JavaScript function.