Citi Interview Question

How to derive OLS closed-form solution.