Scott Logic Interview Question

Boxes and arrows type design question.