Camerinfolks Interview Question

which algorithm would you choose for this task?