Two Sigma interview question

Derive the closed form solution for a cost function