Bank of America interview question

Python algorithms and functions. How to solve an optimization problem Linear regression