Quantcast interview question

How would you optimize an arbitrary function?