Fractal Interview Question

Given some coding questions , you will need to solve it on real time