See 2 comments are there,
Comment 1: we initialize front and rear as -1, so first element should be inserted at q[2].
Comment 2: Correct. So when we initialize to -1, the element is inserted at [0].
The question says
The front and rear pointers are initialized to point at q[2]
So, element is inserted at q[3]
I hope you understand