OLA Electric interview question

How do you go about optimizing cost for a given BoM?