Hachette UK interview question

Can you explain your thought process behind this task