Astek interview question

how do you optimize your algorithme