OLA Electric Interview Question

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