UBS Interview Question

A question on inheritance that was done on paper.