OnGraph Interview Question

Logical question