So for GCSE the key to this question is in the periodic table: Note drawing the atoms can be helpful to show the shells.
F: 2,7
Cl: 2,8,7
Firstlet's look up Flurorine (symbol F in the table). We want it's atomic number (the smaller of the two and always a whole number). This will tell us the number of electrons in a Fluorine atom. From this we fill the shells with electrons, starting with the first shell. It can have 2, the second can have 8 and the rest also have 8. So Fluorine has a configuration of 2,7 (It has 9 as it's atomic number, telling us the number of electrons).
Now we will repeat the same thing for Chlorine but we could also notice it is one whole row below Fluroine which means you just add another whole shell in between them. 2,8,7. The 8 is the added bit in the middle and we can check this is correct because the atomic number of Chlorine is 17 (2+8+7) so our answer makes sense. Although we could have done it the same way we did Flurorine, building up the shells.