Recology interview question

i didn't get this far