OnGraph interview question

Logical question