Carts Guru Interview Question

I was asked a logic question in the technical interview.