rebuy Interview Question

how do you decide which algorithm to use?