Scott Logic interview question

Boxes and arrows type design question.