IDP Connect interview question

Logical reasoning