You are viewing a free preview of this lesson.
Subscribe to unlock all 4 lessons in this course and every other course on LearningBro.
This lesson covers everything you need to know about OCR A-Level Computer Science Paper 2 — the structure, question types, pseudocode conventions, trace table technique, common algorithm questions, and how to approach design questions. Paper 2 is heavily practical in focus, and the skills tested here require regular coding practice as well as theoretical understanding.
Paper 2 is a written exam lasting 2 hours 30 minutes with a total of 140 marks. It accounts for 40% of your A-Level. The paper tests the following areas of the specification:
| Section | Topic Area |
|---|---|
| 2.1 | Elements of computational thinking |
| 2.2 | Problem solving and programming |
| 2.3 | Algorithms |
Unlike Paper 1, which is primarily theoretical, Paper 2 is focused on problem solving, algorithms, and programming. You will be asked to read code, trace code, write code, design algorithms, and analyse the efficiency of solutions.
Key Point: Paper 2 questions are cumulative — concepts from 2.1 (computational thinking) underpin the problem-solving in 2.2, which in turn requires the algorithmic knowledge from 2.3. Revise these sections as a connected whole, not as isolated topics.
You are given a section of pseudocode and asked to determine the output, complete a trace table, or identify the purpose of the code.
You are asked to write an algorithm in pseudocode or a named programming language to solve a given problem. This can range from a simple function to a multi-part solution involving data structures.
You are given code that contains errors (logic errors, syntax errors, or both) and asked to identify and correct them.
You are asked to compare algorithms in terms of time complexity, space complexity, suitability for different data sets, or practical advantages and disadvantages.
These are extended questions where you must design a complete algorithm or data structure solution for a described scenario. They may require you to justify your design choices.
Questions about abstraction, decomposition, pattern recognition, and algorithmic thinking applied to real-world scenarios.
OCR has specific pseudocode conventions that appear on the exam paper. You should be familiar with these so you can read the questions fluently and write answers that examiners can follow.
Assignment uses the equals sign. Output uses the print keyword.
x = 5
name = "Alice"
print(x)
print("Hello " + name)
if condition then
// statements
elseif condition then
// statements
else
// statements
endif
For loop:
for i = 0 to 9
print(i)
next i
While loop:
while condition
// statements
endwhile
Do-while loop:
do
// statements
until condition
Arrays are zero-indexed in OCR pseudocode. You declare and access them using square brackets.
array names[5]
names[0] = "Alice"
names[1] = "Bob"
To iterate through an array:
for i = 0 to names.length - 1
print(names[i])
next i
Procedure (does not return a value):
procedure greet(name)
print("Hello " + name)
endprocedure
Function (returns a value):
function add(a, b)
return a + b
endfunction
x = "Hello"
x.length // returns 5
x.substring(0, 3) // returns "Hel" (start index, length)
ASC("A") // returns 65
CHR(65) // returns "A"
myFile = openRead("data.txt")
line = myFile.readLine()
myFile.close()
myFile = openWrite("output.txt")
myFile.writeLine("Hello")
myFile.close()
Exam Tip: You do not have to memorise every pseudocode convention — the key ones are printed on the exam paper. However, being fluent with them means you can read and write pseudocode quickly, saving valuable time.
Trace tables are one of the most frequently examined skills on Paper 2. A systematic approach avoids careless errors.
Consider this pseudocode:
x = 10
y = 3
while x > 0
x = x - y
y = y + 1
print(x)
endwhile
Trace table:
| x | y | x > 0? | Output |
|---|---|---|---|
| 10 | 3 | ||
| 7 | 4 | true | 7 |
| 3 | 5 | true | 3 |
| -2 | 6 | true | -2 |
| false |
The output is: 7, 3, -2
Exam Tip: The most common error in trace tables is getting the loop termination wrong. Always check the condition at the correct point in the loop. For a while loop, the condition is checked BEFORE the body executes. For a do-until loop, the condition is checked AFTER the body executes.
You must know the following sorting algorithms in detail — how they work step by step, their time complexity, and when each is most suitable.
Bubble Sort:
Subscribe to continue reading
Get full access to this lesson and all 4 lessons in this course.