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.

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:

ModeTopicsQuestionsTimeEach question is worth
Quiz 1 (Python): exceptions, classes and inheritanceT01-T03 (weeks 1-5)1010 min1 mark
Final Python quizT01-T07 (weeks 1-9)1010 min1 mark
Java quizT08-T23 (weeks 10-13)1515 min0.67 marks
Resit (Python and Java)T01-T232020 min0.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.

How the questions are shared out in each modeFour rows, one per mode. Quiz 1: 10 questions on T01 to T03 in 10 minutes, one mark each. Final Python quiz: 10 questions on T01 to T07 (two from T01, T02 and T03 and one from T04 to T07). Java quiz: 15 questions on T08 to T23, one per topic in 15 of the 16, in 15 minutes, 0.67 marks each. Resit: 20 questions in 20 minutes, 7 Python (one per topic) and 13 Java, 0.5 marks each.How the questions are shared out in each modePythonJavaQuiz 1T01-T0310 qs · 10 min · 1 mark each3 or 4 from each topic (T01, T02, T03)Final Python quizT01-T0710 qs · 10 min · 1 mark each2 from T01, T02 and T03 · 1 from T04 to T07Java quizT08-T2315 qs · 15 min · 0.67 marks eachone per topic in 15 of the 16 Java topicsResitT01-T2320 qs · 20 min · 0.5 marks each7 Python (one per topic) + 13 Java (13 of the 16 topics)
Each square is a question: violet, Python; coral, Java. They are all worth the same within their mode.

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:

TopicExercises (with their quiz)QuestionsUsed in
T01Exceptions in Python14Q1, final Python, resit
T02Classes in Python14Q1, final Python, resit
T03Inheritance in Python14Q1, final Python, resit
T04Operator overloading13Final Python, resit
T05Iterators and generators13Final Python, resit
T06Testing in Python (unittest)13Final Python, resit
T07Linked lists in Python13Final Python, resit
T08Java syntax11Java, resit
T09Variables in Java11Java, resit
T10Control flow in Java11Java, resit
T11Loops in Java11Java, resit
T12Methods in Java11Java, resit
T13Arrays in Java11Java, resit
T14Strings in Java11Java, resit
T15Regular expressions in Java11Java, resit
T16Classes and objects in Java11Java, resit
T17Inheritance in Java11Java, resit
T18Exceptions in Java11Java, resit
T19Interfaces in Java11Java, resit
T20Comparable and Cloneable11Java, resit
T21Iterators in Java11Java, resit
T22Java collections11Java, resit
T23Java LinkedList11Java, 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

FormatIf rightIf wrongBlank
Single choice (4 options)its whole valuesubtracts a third of its value0
Multiple choice(right − wrong) / correct optionswrong ticks subtract, but the question never goes below 00
T/F, gaps, matching, orderingshare of correct parts0 for what you miss0
Short answer («what does it print?»)its whole value00

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:

ModeEach questionOne wrong single choiceSingle-choice questions on average
Quiz 1 and final Python quiz1−0.33about 3 per mock exam
Java quiz0.67−0.22about 3-4
Resit0.5−0.17about 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.

Should I answer or leave it blank? Single choice with 4 optionsWhat you gain on average by answering a single-choice question worth 1 mark, where a wrong answer subtracts a third. If you know it: plus 1. Torn between 2: plus 0.33. Torn between 3: plus 0.11. No idea at all: 0, the same as leaving it blank. In every other format answering never subtracts.Should I answer or leave it blank? Single choice with 4 options0I know it+1Torn between 2+0.33Torn between 3+0.11No idea (4 options)0average gainBlank: 0If wrong: −0.33Multiple choice, T/F, gaps, matching, ordering and «what does it print?»: answering never subtracts.
With a 1-mark question: as soon as you rule out one option, answering pays off on average. A blind guess makes no difference.

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:

ModeFirst roundSecond roundCheck
Quiz 1 / final Python quiz (10 min)6 min3 min1 min
Java quiz (15 min)9 min4 min2 min
Resit (20 min)12 min6 min2 min
  1. 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.
  2. 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.
  3. 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:

  1. 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.
  2. 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.
  3. 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.
  4. 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

ModeQuestions and timeEach questionOne wrong single choice
Quiz 1 (T01-T03)10 in 10 min1−0.33
Final Python quiz (T01-T07)10 in 10 min1−0.33
Java quiz (T08-T23)15 in 15 min0.67−0.22
Resit (T01-T23)20 in 20 min0.5−0.17

Three ideas to take away:

  1. One minute per question and they are all worth the same: two rounds, and no question deserves getting stuck on.
  2. Only single choice subtracts, and not much: if you can rule out one option, answer; in every other format, always answer.
  3. 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 articles

Did this article help you? Here is how you can support SergioLearns →