FP2 theory mock exam — Python, Java or the resit, against the clock and with your real mark (just like in the lab)
The FP2 theory quizzes have a catch: they are not hard, they are fast. Ten questions in ten minutes (or fifteen in fifteen, in the Java one) is enough to read, think for a moment and answer. It is not enough to go over what __iter__ did or to hesitate for five minutes between two options. That is why what works best is not reading more theory, but practising with the clock in front of you.
That is what this mock exam is for. You choose the mode (the same ones as in the course: Python quiz 1, the final Python quiz, the Java quiz or the resit), the mock exam picks random questions from the exam-style quizzes of the 22 FP2 topics on the site, starts the clock and, when you hand in, gives you your mark out of 10 with the penalty, a breakdown by topic and a review of every mistake with its explanation. Below I explain what each quiz is like, how it is marked (with the numbers worked out) and how to split your time.
Table of Contents
Take the mock exam
The mock exam needs JavaScript. In the meantime, practice with each topic's quiz (the «What each mode covers» table, below).
Do it as if it were real. No notes, no running the code on your computer and the clock in sight. If you look things up, the mark stops telling you anything.
The questions are original, written for SergioLearns. They ask about the same concepts and use the same formats as the lab quizzes, but they are not the exam questions. Every time you start a mock exam you get different ones.
What the FP2 theory quizzes are like
FP2 theory is not assessed with a long paper exam but with short quizzes on the lab computers: a timer, one attempt and questions in very different formats. There is one halfway through the Python part, another when it ends, another for Java and, if needed, the resit with everything:
| Mode | Topics | Questions | Time | Each question is worth |
|---|---|---|---|---|
| Quiz 1 (Python): exceptions, classes and inheritance | T01-T03 (weeks 1-5) | 10 | 10 min | 1 mark |
| Final Python quiz | T01-T07 (weeks 1-9) | 10 | 10 min | 1 mark |
| Java quiz | T08-T23 (weeks 10-13) | 15 | 15 min | 0.67 marks |
| Resit (Python and Java) | T01-T23 | 20 | 20 min | 0.5 marks |
Look at the last column: every question is worth the same within its mode (10 divided by the number of questions). There is no «big» question that decides whether you pass: each one counts the same, whether it is a five-line «what does it print?» or a true/false.
And in the first two columns, something else: the final Python quiz asks about T01-T03 again. Exceptions, classes and inheritance are not «passed and forgotten»: they come back at the end of Python and again in the resit.
This is how the mock exam shares the questions out among the topics, in proportion to how many questions each one has (14 in T01-T03, 13 in T04-T07 and 11 in each Java topic):
- Quiz 1: 10 across 3 topics = 3.33 per topic, so you get 3 from each and the one left over goes to one of the three at random (3 + 3 + 4).
- Final Python quiz: 10 across 7 topics. T01-T03 weigh a little more (14 questions against 13), so you get 2 from T01, T02 and T03 and 1 from T04 to T07 (2 × 3 + 1 × 4 = 10).
- Java quiz: 16 topics and 15 questions: one from each topic in 15 of the 16, from Syntax to LinkedList; the one left without a question is chosen at random.
- Resit: 20 across 23 topics. Each Python topic comes up once (7) and the other 13 go to 13 of the 16 Java topics, chosen at random (7 + 13 = 20). Each Java topic has a 13/16 ≈ 81 % chance of coming up.
The Java quiz is the «fairest» of the four: exactly one question from each topic. If you are weak on one topic, you know it will cost you one question, no more and no less.
What each mode covers
The mock exam’s question bank is the exam-style quizzes at the end of each topic’s exercises (the «Exam-style quiz» section). If you want to practice a single topic, or the mock exam shows you that one is letting you down, this is where to go:
| Topic | Exercises (with their quiz) | Questions | Used in |
|---|---|---|---|
| T01 | Exceptions in Python | 14 | Q1, final Python, resit |
| T02 | Classes in Python | 14 | Q1, final Python, resit |
| T03 | Inheritance in Python | 14 | Q1, final Python, resit |
| T04 | Operator overloading | 13 | Final Python, resit |
| T05 | Iterators and generators | 13 | Final Python, resit |
| T06 | Testing in Python (unittest) | 13 | Final Python, resit |
| T07 | Linked lists in Python | 13 | Final Python, resit |
| T08 | Java syntax | 11 | Java, resit |
| T09 | Variables in Java | 11 | Java, resit |
| T10 | Control flow in Java | 11 | Java, resit |
| T11 | Loops in Java | 11 | Java, resit |
| T12 | Methods in Java | 11 | Java, resit |
| T13 | Arrays in Java | 11 | Java, resit |
| T14 | Strings in Java | 11 | Java, resit |
| T15 | Regular expressions in Java | 11 | Java, resit |
| T16 | Classes and objects in Java | 11 | Java, resit |
| T17 | Inheritance in Java | 11 | Java, resit |
| T18 | Exceptions in Java | 11 | Java, resit |
| T19 | Interfaces in Java | 11 | Java, resit |
| T20 | Comparable and Cloneable | 11 | Java, resit |
| T21 | Iterators in Java | 11 | Java, resit |
| T22 | Java collections | 11 | Java, resit |
| T23 | Java LinkedList | 11 | Java, resit |
In total, 259 questions: 94 on Python (14 × 3 + 13 × 4 = 42 + 52) and 165 on Java (11 × 15). The bank sizes you see in the mock exam before you start come from here: 42 in quiz 1, 94 in the final Python quiz, 165 in the Java quiz and 259 in the resit.
The formats are the lab ones: single choice, multiple choice, true/false, gaps, matching, ordering and, above all, «what does it print?»: a piece of code and you write the output (or choose whether it compiles). They are almost 4 in 10 of the Python questions and more than half of the Java ones. If you take the mock exam several times, on average you will get about 4-5 questions with code in the Python quizzes, about 8-9 out of 15 in the Java one and about 10 out of 20 in the resit.
Studying the theory «by reading» and never tracing code by hand. In these quizzes it is not enough to know what a generator is: you have to know what this generator prints with this data, without running it. Practice tracing on paper.
How it is marked: the penalty, explained
| Format | If right | If wrong | Blank |
|---|---|---|---|
| Single choice (4 options) | its whole value | subtracts a third of its value | 0 |
| Multiple choice | (right − wrong) / correct options | wrong ticks subtract, but the question never goes below 0 | 0 |
| T/F, gaps, matching, ordering | share of correct parts | 0 for what you miss | 0 |
| Short answer («what does it print?») | its whole value | 0 | 0 |
The only question that can take marks away is single choice: each wrong answer subtracts 1/(n − 1) of its value, and with 4 options that is a third. Why a third? Because that way a random guess comes out, on average, the same as leaving it blank: you are right 1 time in 4 (+1) and wrong 3 times (−1/3 each), and 1/4 × 1 − 3/4 × 1/3 = 0.25 − 0.25 = 0.
With the values of each mode:
| Mode | Each question | One wrong single choice | Single-choice questions on average |
|---|---|---|---|
| Quiz 1 and final Python quiz | 1 | −0.33 | about 3 per mock exam |
| Java quiz | 0.67 | −0.22 | about 3-4 |
| Resit | 0.5 | −0.17 | about 5 |
Three examples of marks, so you can see how it all adds up:
- Quiz 1: 7 right, 2 single-choice wrong and 1 blank → 7 × 1 − 2 × 0.33 = 7 − 0.67 = 6.33.
- Java quiz: 11 right, 2 single-choice wrong and 2 blank → 11 × 0.67 − 2 × 0.22 = 7.33 − 0.44 = 6.89.
- Resit: 14 right, 3 single-choice wrong and 3 blank → 14 × 0.5 − 3 × 0.17 = 7 − 0.5 = 6.5.
And one multiple-choice example: in a Java question with 3 correct options, you tick 2 right ones and 1 wrong one → (2 − 1) / 3 = a third of 0.67 = 0.22. Had you ticked only the 2 right ones, (2 − 0) / 3 = 0.44.
The penalty is small. Even if you got every single-choice question in the Java quiz wrong (about 3.5 on average), you would lose about 0.78 marks. What really brings your mark down is questions left blank because you ran out of time.
Should I answer or leave it blank?
It only makes sense to ask yourself this with single-choice questions. With every other format, always answer: a half-right T/F, a filled-in gap or an approximate output cannot subtract.
For single choice the rule is simple: if you can rule out at least one option, answer. With a 1-mark question, torn between 3 you gain on average 1/3 × 1 − 2/3 × 1/3 = 0.33 − 0.22 = +0.11; torn between 2, 1/2 × 1 − 1/2 × 1/3 = 0.5 − 0.17 = +0.33. A pure guess (all 4 options possible) gives exactly 0: whatever you do makes no difference, so do not waste time and move on to the next one.
In code questions with options you can almost always rule something out. If the code throws an exception, the option with «normal» output is usually out; if there is a print inside a 3-iteration loop, so is the option with a single line.
How to split your time
One minute per question, in all four modes. It sounds tight, but some questions take 15 seconds (a concept T/F) and others 2 minutes (a «what does it print?» with a loop). The plan that works best is two rounds:
| Mode | First round | Second round | Check |
|---|---|---|---|
| Quiz 1 / final Python quiz (10 min) | 6 min | 3 min | 1 min |
| Java quiz (15 min) | 9 min | 4 min | 2 min |
| Resit (20 min) | 12 min | 6 min | 2 min |
- First round: answer everything you know straight away and, if a trace takes longer than a minute, leave it and move on. The counter at the top («7/10 answered») tells you how many are left.
- Second round: go back to the code questions you skipped. Now you know how much time you have left and can trace them calmly, on paper.
- Check: make sure nothing is left blank except a single-choice question where you cannot rule out any option. If you try to hand in with blank questions, the button tells you how many there are.
Getting stuck on question 3 with an iterator trace and handing in with the last 7 blank. With 10 questions, every one you do not read is 10 marks out of 100. No question is worth more than another: none is worth fighting with.
In «what does it print?», write the exact output, without quotes. The mock exam ignores capitals, accents and signs like the full stop, the comma or brackets, but not everything else: [3, 4] is not the same as 3 4, and True is not the same as 1.
How the mock exam works under the hood
- Live bank. When you choose the mode, the mock exam reads in your browser the published exam-style quizzes of the FP2 exercises (the ones in the table above) and keeps those from the topics of that mode. If a topic or a question is ever added, it comes in on its own.
- Random questions, shared out by topic. None repeated within the same mock exam and with the split from the previous section. «New mock exam (other questions)» gives you another set.
- No solutions until you hand in. During the exam there is no «Check» button and no explanations, as in the lab. You can hide the timer if it makes you nervous; when it reaches 0, the mock exam hands itself in.
- When you hand in: your mark out of 10, pass or not yet, how many you got right, partly right, wrong and blank, the time you used and a breakdown by topic. Each question shows its solution, its explanation and a «Review this topic» link to the exercises it comes from.
- «Show only mistakes and blanks» hides the ones you got right, for a quick review. «Download as PDF» opens your browser’s print dialog with the questions, your answers, the solutions and your mark.
- Nothing is saved or sent: everything happens in your browser. If you close the tab, the mock exam is gone.
If the bank cannot be loaded (no connection or the server is down), the mock exam tells you so and you can practice with each topic’s quiz from the table above.
After the mock exam: what to review
The breakdown by topic is the most useful part of the result. Use it like this:
- A topic at 0 % is not bad luck: go to its exercises, redo that topic’s whole quiz (11-14 questions) and read the explanations of the ones you get wrong.
- Mistakes in «what does it print?»: go back to that question and trace the code by hand, step by step. If you cannot see where you go wrong, the Python Tutor section in the topic’s exercises lets you watch it live.
- Single-choice mistakes made in a hurry (you knew the answer and ticked another): that is a reading problem, not a theory one. Next time, read the whole question before looking at the options.
- Repeat the mock exam the next day with other questions. If you pass three times in a row with a 7 or more, you are on track.
For quiz 1, focus on the order of try/except/else/finally, on which attributes belong to the class and which to the instance and on which method runs with super(). For the Java one, on what has the most traps: integer division, == versus equals with Strings, the missing break in a switch and which exceptions you must catch no matter what.
Summary
| Mode | Questions and time | Each question | One wrong single choice |
|---|---|---|---|
| Quiz 1 (T01-T03) | 10 in 10 min | 1 | −0.33 |
| Final Python quiz (T01-T07) | 10 in 10 min | 1 | −0.33 |
| Java quiz (T08-T23) | 15 in 15 min | 0.67 | −0.22 |
| Resit (T01-T23) | 20 in 20 min | 0.5 | −0.17 |
Three ideas to take away:
- One minute per question and they are all worth the same: two rounds, and no question deserves getting stuck on.
- Only single choice subtracts, and not much: if you can rule out one option, answer; in every other format, always answer.
- More than half are code questions: practice tracing by hand with each topic’s quiz before repeating the mock exam.
This mock exam is part of the exams and mock exams section, where you will also find the ones for the other first-year subjects. Good luck in the lab!
Keep goingAll Java articlesDid this article help you? Here is how you can support SergioLearns →




FP2 theory mock exam — Python, Java or the resit, against the clock and with your real mark (just like in the lab)