This is the link for the question, http://filestore.aqa.org.uk/sample-papers-and-mark-schemes/2016/june/AQA-ELEC1-QP-JUN16.PDF
The diagram shows the relationships bewteen letters. C and D are the inverse of the A and B respectively. For example, when A = 1, C is the inverse of A, so 0. E and F are logical AND gates. The inputs to E are B and C. When B & C are equal to 1, E will output a value of 1. Otherwise, output E is 0. Same logic applies to gate F. A and D are the inputs to gate F. Q is the OR gate. Q will output a '1' if either of the input is 1. E and F are inputs to Q. If either E or F is a '1', Q will produce 1. If both inputs are 0s, Q will produce 0.
By knowing the above relationships, we can derive the table from the given values of A and B.