Fractal interview question

Matrix based question