GIC Interview Question

Deriving the solution of simple linear regression,