I am currently practising UKMT questions and this question was from the 1998 IMC.

I am struggling to picture how this works. Does the $x$ amount of people behind Wallace equal the $y$ amount of places in front of Gromit? I don't really see the differences between $x,y$ and $n$. Aren't they all the same? I know which one's the answer but it would really help if someone explained how this works with maybe a diagram? Thank you.
Draw the queue like this, where $W$ is wallace and $G$ is gromit:
$$ \begin{array}{ccccc} \cdots & G & \cdots & W & \cdots \end{array} $$
Let's call $a,b,c$ the number of people in line in each of the segments labelled "$\cdots$''. So there are $a$ people behind Gromit, $b$ people in between them, and $c$ people after Wallace. Let's think about what each statement in the original problem says:
You should be able to use these equations to solve for $a$ and $c$. Finally, the total number of people in line is $a+b+c+2$.
Alternate Way: Add all the people behind Wallace plus all the people in front of Gromit. This gives $x+n$. But this double-counts all the people in between, of which there are $y-1$. So the total is $x+n-(y-1)$.