Bentley Systems Interview Question

How to solve the diamond problem