Revision Library
Choose a subject
Menu
Computer Science
Need a new topic?
Missing a topic, found a bug, or want something added?

AS Paper 6: Full AS Review

A full review paper covering every AS topic: data representation, boolean logic and logic gates, computer architecture, networks, linear data structures, searching and sorting algorithms and writing and tracing short programs.

28 questions - 100 marks

Download PDF

Open A Level Computer Science workspace

Questions

Question 1 [2 marks]

Boolean Algebra and Logic Gates

State the output of the logic expression A OR B for each of the four possible combinations of A and B (each 0 or 1).

Question 2 [2 marks]

Searching and Sorting Algorithms

The sorted list [4, 9, 15, 23, 31, 38, 47] is searched using a binary search for the value 38.

State the index (counting from 0) of each middle element checked, in order, until 38 is found.

Question 3 [2 marks]

Networks and Communication

A LAN (Local Area Network) covers a small geographical area, such as a single building. A WAN (Wide Area Network) covers a much larger geographical area, such as a whole country or the world.

Give one example of a LAN and one example of a WAN.

Question 4 [3 marks]

Programming: Trace, Write and Explain

The following pseudocode is executed:

product = 1

n = 4

WHILE n > 0

product = product * n

n = n - 1

ENDWHILE

OUTPUT product

Complete a trace of the values of product and n after each iteration of the loop, and state the value output.

Question 5 [3 marks]

Computer Architecture and the CPU

Describe the three main stages of the fetch-decode-execute cycle for a simple CPU.

Question 6 [3 marks]

Linear Data Structures

A queue is a linear data structure that follows First In First Out (FIFO).

The following operations are performed on an empty queue: enqueue(A), enqueue(B), enqueue(C), dequeue(), enqueue(D).

State the contents of the queue, from front to back, after these operations.

Question 7 [3 marks]

Data Representation

Convert the hexadecimal number 2F into denary, and then into an 8-bit binary number.

Question 8 [3 marks]

Searching and Sorting Algorithms

The list [8, 3, 6, 1] is sorted using a bubble sort. Each pass compares adjacent elements and swaps them if they are in the wrong order, working from the start of the list to the end.

State the contents of the list after one complete pass.

Question 9 [4 marks]

Data Representation

Convert the denary number 200 into hexadecimal, and then into an 8-bit unsigned binary number.

Question 10 [2 marks]

Boolean Algebra and Logic Gates

Simplify the Boolean expression Y = (NOT (NOT A)) OR (A AND A), showing each law used.

Question 11 [3 marks]

Programming: Trace, Write and Explain

A student writes the following pseudocode, intended to output the numbers 1 to 5:

i = 1

j = 1

WHILE i <= 5

OUTPUT i

j = j + 1

ENDWHILE

Explain why this code never terminates, and rewrite the loop body so it correctly outputs 1 to 5 and then stops.

Question 12 [4 marks]

Linear Data Structures

A singly linked list stores each node as a value and a pointer to the next node. The list currently holds, in order, 5 -> 12 -> 19 -> 27, with a head pointer to the node holding 5.

Describe, as a sequence of steps, how a new node holding the value 15 is inserted so the list becomes 5 -> 12 -> 15 -> 19 -> 27. You do not need to write code.

Question 13 [4 marks]

Searching and Sorting Algorithms

Merge sort works by splitting a list in half repeatedly until each sublist has one element, then merging sublists back together in sorted order.

The list [8, 3, 6, 1] is sorted using merge sort. State the sublists formed after the list is fully split, and show the result of merging back up to the final sorted list.

Question 14 [4 marks]

Networks and Communication

A network diagnostic tool called ping sends a small test message to a target device and measures the round-trip time (RTT): the time taken for a reply to come back.

A technician pings a server five times and records round-trip times of 20 ms, 22 ms, 21 ms, 95 ms and 20 ms.

Calculate the mean round-trip time, and explain why the 95 ms result might be worth investigating separately rather than simply being averaged in.

Question 15 [4 marks]

Data Representation

Two 8-bit unsigned binary numbers, 11001101 and 00111010, are added together using binary addition.

Show the result of the addition, and state whether an overflow has occurred, given that an 8-bit unsigned number can hold values from 0 to 255.

Question 16 [4 marks]

Programming: Trace, Write and Explain

The following pseudocode is executed:

result = ''

FOR i = 1 TO 3

result = result + 'ab'

NEXT i

OUTPUT result

Complete a trace of the value of result after each iteration of the loop, and state the value output.

Question 17 [4 marks]

Networks and Communication

TCP (Transmission Control Protocol) provides reliable, ordered delivery using acknowledgements and retransmission, while a connection remains viable, while UDP (User Datagram Protocol) sends data with no such guarantee, but with less overhead.

State one type of application that would suit TCP and one that would suit UDP, justifying each choice.

Question 18 [4 marks]

Linear Data Structures

Postfix notation places operators after their operands, and is evaluated without needing brackets or precedence rules, since the order is fixed by position.

Convert the infix expression 3 + 4 * 2 into postfix notation, applying the normal precedence rule that multiplication is evaluated before addition.

Question 19 [4 marks]

Computer Architecture and the CPU

A program consists of 5,000,000 instructions. On a particular processor, each instruction takes an average of 3 clock cycles to complete, and the processor runs at a clock speed of 2.5 GHz (2,500,000,000 cycles per second).

Calculate the total number of clock cycles needed to run the program, and hence the total execution time in seconds.

Question 20 [4 marks]

Networks and Communication

Bandwidth is the maximum amount of data that can be transferred over a connection per second. Latency is the delay between sending data and it beginning to arrive at its destination.

Assume both connections have enough bandwidth to carry the video call. The video call benefits greatly from low latency, while downloading a very large file benefits greatly from high bandwidth.

Explain the difference between bandwidth and latency, and explain why the video call scenario prioritises latency while the large file download prioritises bandwidth.

Question 21 [5 marks]

Linear Data Structures

A doubly linked list stores each node as a value, a pointer to the next node and a pointer to the previous node. The list currently holds, in order, 4 <-> 9 <-> 15 <-> 22, with a head pointer to the node holding 4.

Describe, as a sequence of steps, how the node holding 15 is removed so the list becomes 4 <-> 9 <-> 22. You do not need to write code.

Question 22 [2 marks]

Boolean Algebra and Logic Gates

Simplify the Boolean expression Y = (A OR B) AND (A OR (NOT B)), showing each law used.

Question 23 [3 marks]

Programming: Trace, Write and Explain

A function is defined as: FUNCTION AddOne(n): n = n + 1, RETURN n, ENDFUNCTION

In the main program: x = 5, y = AddOne(x), OUTPUT x, OUTPUT y

State the values output for x and y, and explain, in terms of parameter passing, why x is not changed by the call to AddOne even though the function reassigns its parameter n.

Question 24 [4 marks]

Networks and Communication

A packet-filtering firewall examines each packet's header, such as its source and destination IP address and port number, and allows or blocks it based on a set of rules, without looking at the actual data (payload) it carries.

An application-level (proxy) firewall instead inspects the actual content of the traffic for a specific application, such as checking the content of web pages being requested. Assume the application content is available to the proxy for inspection.

Explain one advantage the application-level firewall has over the packet-filtering firewall, and one disadvantage.

Question 25 [2 marks]

Boolean Algebra and Logic Gates

A logic circuit has inputs A, B and C, and its output Z is 1 for exactly these combinations: A = 0, B = 1, C = 1 and A = 1, B = 1, C = 1, and Z is 0 for every other combination.

Write the Boolean expression for Z as a sum of products (before simplification), then simplify it to its shortest form.

Question 26 [6 marks]

Data Representation

A bitmap image is 320 pixels wide and 240 pixels high. Each pixel is stored using a colour depth of 16 bits.

Calculate the file size of the uncompressed image in bytes, then in kilobytes, using 1 KB = 1000 bytes, giving your kilobyte answer to 1 decimal place.

State the number of distinct colours this colour depth can represent.

Question 27 [6 marks]

Networks and Communication

A 2 megabyte (MB, where 1 MB = 1,000,000 bytes) file is sent over a connection with a bandwidth of 8 megabits per second (Mbps, where 1 Mbps = 1,000,000 bits per second) and a one-way latency of 50 milliseconds before any data starts to arrive.

Calculate the total time taken for the file to be fully received, from the moment sending begins, including both the latency and the time needed to transfer the data itself.

Question 28 [6 marks]

Programming: Trace, Write and Explain

The greatest common divisor (GCD) of two positive integers can be calculated using the Euclidean algorithm: GCD(a, b) is a if b = 0, otherwise it is GCD(b, a MOD b).

Write pseudocode for a recursive function called GCD that takes two integer parameters, a and b, and implements this definition.

Trace the calls made when GCD(18, 12) is evaluated, and state the value returned.

Model solutions

Mark scheme for Question 1 [2 marks]
Question 1[2 marks]
Answer or workingMarks
the labelled rows 00 -> 0 and 01 -> 1B1
the labelled rows 10 -> 1 and 11 -> 1B1
Final answer: 00 -> 0; 01 -> 1; 10 -> 1; 11 -> 1.
Mark scheme for Question 2 [2 marks]
Question 2[2 marks]
Answer or workingMarks
the first middle element checked being index 3 (value 23), then narrowing to the upper half since 38 > 23M1
the second middle element checked being index 5 (value 38), where the target is found Award all 2 marks for a complete correct answer to the requested task. Accept equivalent valid explanations and notation. Method details not explicitly requested may be inferred from the correct requested results. Both checked indices are requested; values and direction are optional evidence.A1
Final answer: Indices 3, then 5.
Mark scheme for Question 3 [2 marks]
Question 3[2 marks]
Answer or workingMarks
a valid LAN example, such as the network inside a single school or office buildingB1
a valid WAN example, such as the internet, or a company's network connecting offices in different citiesB1
Final answer: LAN example: a school's internal network; WAN example: the internet
Mark scheme for Question 4 [3 marks]
Question 4[3 marks]
Answer or workingMarks
post-iteration (product,n) pairs (4,3) and (12,2)M1
post-iteration pairs (24,1) and (24,0)M1
output 24A1
Final answer: (product,n): (4,3), (12,2), (24,1), (24,0); output 24.
Mark scheme for Question 5 [3 marks]
Question 5[3 marks]
Answer or workingMarks
fetch - the instruction at the address held in the PC is fetched from memory and the PC is incrementedB1
decode - the fetched instruction is interpreted to determine what operation it representsB1
execute - the decoded instruction is carried out, for example by the ALU or by transferring dataB1
Final answer: Fetch (get the instruction addressed by the PC, incrementing the PC), decode (interpret the instruction), execute (carry it out)
Mark scheme for Question 6 [3 marks]
Question 6[3 marks]
Answer or workingMarks
enqueuing A, B and C to give the order A, B, C from front to backM1
dequeue() removing A from the front, leaving B, CM1
enqueue(D) giving the final order B, C, D Award all 3 marks for the complete correct requested answer: Front to back: B, C, D. Accept equivalent valid notation and explanations. Intermediate method evidence below is optional and may be inferred from a correct requested result; do not require unasked states or extra explanations.A1
Final answer: Front to back: B, C, D.
Mark scheme for Question 7 [3 marks]
Question 7[3 marks]
Answer or workingMarks
converting each hex digit to decimal: 2 = 2, F = 15M1
denary 47 (2 x 16 + 15)A1
8-bit binary 00101111A1
Final answer: Denary 47, binary 00101111
Mark scheme for Question 8 [3 marks]
Question 8[3 marks]
Answer or workingMarks
swapping 8 and 3 to give 3, 8, 6, 1M1
swapping 8 and 6, then swapping 8 and 1, moving 8 towards the endM1
the list 3, 6, 1, 8 after one pass Award all 3 marks for the complete correct requested answer: After one pass: [3,6,1,8]. Accept equivalent valid notation and explanations. Intermediate method evidence below is optional and may be inferred from a correct requested result; do not require unasked states or extra explanations.A1
Final answer: After one pass: [3,6,1,8].
Mark scheme for Question 9 [4 marks]
Question 9[4 marks]
Answer or workingMarks
converting 200 to hexadecimal by finding 200 = 12 x 16 + 8M1
hexadecimal C8 (12 = C, 8 = 8)A1
converting 200 to binary by summing place values 128 + 64 + 8M1
8-bit binary 11001000 Award equivalent credit for another valid complete conversion method; the particular listed route is not compulsory.A1
Final answer: Hexadecimal C8, binary 11001000
Mark scheme for Question 10 [2 marks]
Question 10[2 marks]
Answer or workingMarks
showing valid laws for a complete simplification, such as double negation and idempotence, or double negation and absorptionM1
Y = AA1
Final answer: Y = A by double negation and idempotence. Double negation: NOT NOT A = A. Idempotence: A AND A = A. Idempotence again: A OR A = A.
Mark scheme for Question 11 [3 marks]
Question 11[3 marks]
Answer or workingMarks
explaining that only j changes, so i stays 1 and the guard i <= 5 never becomes falseB1
retaining OUTPUT i in the repaired loop bodyM1
incrementing i by 1 after output, producing 1 to 5 and then stopping; removing j is optionalA1
Final answer: i remains 1 because only j changes, so i <= 5 is always true and 1 is output repeatedly. Replace the loop body with OUTPUT i followed by i = i + 1.
Mark scheme for Question 12 [4 marks]
Question 12[4 marks]
Answer or workingMarks
creating a new node holding the value 15B1
traversing from the head until the node holding 12 is reached, the node before the insertion pointB1
setting the new node's pointer to point to the node holding 19B1
setting the pointer of the node holding 12 to point to the new node. Accept any safe equivalent pointer-update sequence, using a saved successor pointer if needed. Do not require an arbitrary allocation/traversal order provided the successor is preserved.B1
Final answer: Allocate a node holding 15. Locate the node holding 12; set the new node next to the old next of 12 (19), then set 12.next to the new node. Head stays 5. Equivalent safe pointer-update sequences are valid.
Mark scheme for Question 13 [4 marks]
Question 13[4 marks]
Answer or workingMarks
splitting the list into single-element sublists: [8], [3], [6], [1]M1
merging [8] and [3] to give [3, 8], and merging [6] and [1] to give [1, 6]M1
merging [3, 8] and [1, 6] by comparing front elements in order: 1, then 3, then 6, then 8A1
the final sorted list [1, 3, 6, 8] Award all 4 marks for a complete correct answer to the requested task. Accept equivalent valid explanations and notation. Method details not explicitly requested may be inferred from the correct requested results. Splits and merge results are requested; individual front comparisons may be inferred from correctly merged results.A1
Final answer: Fully split: [8],[3],[6],[1]. Merge pairs to [3,8] and [1,6], then merge to [1,3,6,8].
Mark scheme for Question 14 [4 marks]
Question 14[4 marks]
Answer or workingMarks
sum = 20 + 22 + 21 + 95 + 20 = 178 ms.M1
mean = 178 / 5 = 35.6 ms.A1
identifying 95 ms as unusually high relative to 20 to 22 ms and a possible transient delay.B1
explaining the high value pulls the mean away from typical results, warranting separate investigation rather than automatic exclusion.B1
Final answer: 35.6 ms; investigate the 95 ms spike without silently discarding it
Mark scheme for Question 15 [4 marks]
Question 15[4 marks]
Answer or workingMarks
converting each operand to denary (or working directly in binary): 205 and 58M1
correctly computing the sum as 263M1
binary 100000111; accept 00000111 with carry-out 1 as an equivalent representation of the full sum.A1
stating that an overflow has therefore occurredA1
Final answer: 205 + 58 = 263, needing 9 bits; this overflows an 8-bit register, which would incorrectly hold 00000111 (7)
Mark scheme for Question 16 [4 marks]
Question 16[4 marks]
Answer or workingMarks
result = ab after the first iterationM1
result = abab after the second iterationM1
result = ababab after the third iterationA1
output abababA1
Final answer: result: ab, abab, ababab; output ababab.
Mark scheme for Question 17 [4 marks]
Question 17[4 marks]
Answer or workingMarks
a valid TCP application, such as file transfer.B1
linking that choice to complete, ordered delivery and retransmission.B1
a valid UDP application, such as interactive voice.B1
linking that choice to low delay, avoiding retransmission waits or lower overhead, where occasional missing data can be tolerated.B1
Final answer: TCP for file transfer requiring complete ordered data; UDP for interactive voice prioritising timely delivery
Mark scheme for Question 18 [4 marks]
Question 18[4 marks]
Answer or workingMarks
recognising that * has higher precedence than + and so must be converted firstM1
converting the sub-expression 4 * 2 into postfix as 4 2 *M1
combining this with the addition, giving 3 as the first operand followed by the converted sub-expression and the + operatorA1
the final postfix expression 3 4 2 * + Award all 4 marks for the complete correct requested answer: 3 4 2 * + Accept equivalent valid notation and explanations. Intermediate method evidence below is optional and may be inferred from a correct requested result; do not require unasked states or extra explanations.A1
Final answer: 3 4 2 * +
Mark scheme for Question 19 [4 marks]
Question 19[4 marks]
Answer or workingMarks
calculating instructions * cycles per instruction: 5000000 * 3.M1
15000000 cycles.A1
dividing total cycles by 2500000000 cycles/s.M1
0.006 seconds; accept 6 milliseconds.A1
Final answer: 15000000 cycles; 0.006 s = 6 ms
Mark scheme for Question 20 [4 marks]
Question 20[4 marks]
Answer or workingMarks
bandwidth being maximum data transfer rate, typically bits/s.B1
latency being delay in data reaching the destination.B1
explaining that conversational interaction suffers from delay even with sufficient bandwidth.B1
explaining that large-file completion time is strongly affected by sustained transfer rate because many bits must be delivered.B1
Final answer: Bandwidth is transfer capacity; latency is delay; interactive calls need timely exchange and large downloads need sustained throughput
Mark scheme for Question 21 [5 marks]
Question 21[5 marks]
Answer or workingMarks
identifying 9 and 22 as the neighbours of 15.M1
setting 9.next to 22A1
setting 22.previous to 9.A1
bypassing the removed node in both directionsB1
a valid completed deletion sequence. Accept equivalent pointer descriptions and automatic memory reclamation. No comparison with singly linked lists is required.B1
Final answer: Set 9.next to 22 and 22.previous to 9, bypassing 15 in both directions. The list is 4 <-> 9 <-> 22. Reclaim 15 if required; equivalent valid descriptions need no explicit manual deallocation.
Mark scheme for Question 22 [2 marks]
Question 22[2 marks]
Answer or workingMarks
showing valid laws for a complete simplification, such as distributivity, complementarity and identity; accept any valid derivationM1
Y = AA1
Final answer: Y = A. Dual distributivity gives A OR (B AND NOT B). Complementarity gives B AND NOT B = 0. Identity gives A OR 0 = A.
Mark scheme for Question 23 [3 marks]
Question 23[3 marks]
Answer or workingMarks
x = 5A1
y = 6A1
explaining that n receives a copy of the value of x, so reassigning local n does not change xB1
Final answer: x = 5 and y = 6. The parameter receives a copy of the value of x; reassigning local n does not change x.
Mark scheme for Question 24 [4 marks]
Question 24[4 marks]
Answer or workingMarks
one valid advantage over header filtering, such as blocking malicious content within otherwise permitted traffic or enforcing application-specific content rules.B1
explaining how inspection of application content enables the stated advantage beyond what header-only rules can distinguish.B1
one valid disadvantage, such as increased latency, reduced throughput or greater configuration and maintenance complexity.B1
explaining the chosen disadvantage: deeper inspection consumes processing time, or application-specific parsers and rules require more setup and maintenance. Accept another valid linked explanation; neither route is compulsory.B1
Final answer: A proxy can block malicious payloads that pass header rules. It needs application-specific parsers and rules, increasing configuration and maintenance complexity; alternatively, deeper processing can add delay.
Mark scheme for Question 25 [2 marks]
Question 25[2 marks]
Answer or workingMarks
the unsimplified sum of products ((NOT A) AND B AND C) OR (A AND B AND C), accepting reordered termsM1
the shortest expression B AND C; no separate derivation is requestedA1
Final answer: Z = ((NOT A) AND B AND C) OR (A AND B AND C) = B AND C.
Mark scheme for Question 26 [6 marks]
Question 26[6 marks]
Answer or workingMarks
total pixels = 320 x 240 = 76800M1
total bits = 76800 x 16 = 1228800M1
converting bits to bytes by dividing by 8M1
153600 bytesA1
153.6 KBA1
65536 (2^16) distinct coloursA1
Final answer: 153600 bytes, 153.6 KB; 65536 distinct colours
Mark scheme for Question 27 [6 marks]
Question 27[6 marks]
Answer or workingMarks
converting the file size to bits: 2,000,000 x 8 = 16,000,000 bitsM1
stating the bandwidth in bits per second: 8,000,000 bits per secondM1
dividing to find the transfer time: 16,000,000 / 8,000,000M1
a transfer time of 2 secondsA1
converting the latency to seconds (50 ms = 0.05 s) and adding it to the transfer timeM1
a total time of 2.05 secondsA1
Final answer: Transfer time = 2 seconds; total time including latency = 2 + 0.05 = 2.05 seconds
Mark scheme for Question 28 [6 marks]
Question 28[6 marks]
Answer or workingMarks
GCD with parameters a and bM1
b = 0 returning aM1
otherwise returning GCD(b, a MOD b)A1
GCD(18,12) calling GCD(12,6)M1
GCD(12,6) calling GCD(6,0)M1
the base return 6 and final result 6A1
Final answer: FUNCTION GCD(a, b) IF b = 0 THEN RETURN a ENDIF RETURN GCD(b, a MOD b) ENDFUNCTION GCD(18,12) -> GCD(12,6) -> GCD(6,0) -> 6.

Build a free practice pack.

Pick the topics, add the student's name and print one PDF.