Boots Interview Question

Two tasks (provided via e-mail in advance)