Two Sigma Interview Question

Derive the closed form solution for a cost function