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

AS Paper 4: Mixed Practice A

A mixed paper covering data representation, boolean logic and logic gates, computer architecture, networks, linear data structures and searching and sorting algorithms.

22 questions - 80 marks

Download PDF

Open A Level Computer Science workspace

Questions

Question 1 [2 marks]

Networks and Communication

A school network can be arranged using a star topology or a bus topology.

State one advantage and one disadvantage of a star topology compared with a bus topology.

Question 2 [2 marks]

Boolean Algebra and Logic Gates

A logic circuit implements the Boolean expression X = (NOT A) OR (B AND C).

Evaluate X when A = 1, B = 1 and C = 0, and state the general rule for when the OR operator gives an output of 1.

Question 3 [2 marks]

Searching and Sorting Algorithms

The sorted list [3, 7, 12, 18, 24, 31, 40, 52] is searched using a binary search for the value 24. When a list has an even number of elements, take the lower of the two middle elements as the middle.

State the index (counting from 0) of the middle element checked first, and state whether the target is found on this first comparison.

Question 4 [3 marks]

Computer Architecture and the CPU

A CPU is connected to memory using three buses: the address bus, the data bus and the control bus.

State the purpose of each of these three buses.

Question 5 [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 6 [3 marks]

Data Representation

A simple text system needs to represent every uppercase letter of the English alphabet (26 letters) plus the 10 digits 0-9, and no other characters.

Calculate the minimum number of bits needed to represent every character in this set uniquely.

Question 7 [4 marks]

Linear Data Structures

A deque (double-ended queue) allows insertion and removal at both the front and the back.

Starting from an empty deque, the operations addFront(3), addRear(7), addFront(1) and removeRear() are performed in order.

State the contents of the deque, from front to back, after these operations, and state the value returned by removeRear().

Question 8 [1 mark]

Computer Architecture and the CPU

A computer's memory hierarchy includes CPU registers, cache memory and main memory (RAM), typically in that order from fastest to slowest.

State one reason a computer does not simply use registers for all of its memory, given how much faster they are than main memory.

Question 9 [3 marks]

Networks and Communication

In the client-server model, a web browser (the client) requests a web page from a web server.

Describe the roles of the client and the server in this exchange, and state one advantage of the client-server model over a peer-to-peer model for a busy website.

Question 10 [3 marks]

Computer Architecture and the CPU

A company is choosing between a processor with 1 core running at 4.0 GHz and a processor with 4 cores each running at 2.0 GHz, for a program that needs to process a large batch of independent image files. Assume comparable work per clock cycle, enough independent files to keep all cores busy, and negligible scheduling and I/O overheads.

State which processor is likely to complete the batch faster, and explain why, referring to the nature of the task.

Question 11 [4 marks]

Searching and Sorting Algorithms

The list [5, 2, 9, 1, 6] is sorted using insertion sort, which builds a sorted section at the start of the list by inserting each new element into its correct position.

State the contents of the whole list after the first three elements (5, 2, 9) have been inserted into the sorted section, but before 1 is considered.

Question 12 [4 marks]

Networks and Communication

A large file is sent across a network using packet switching, rather than being sent as one continuous stream.

Explain what is meant by packet switching, and state one advantage it has over circuit switching, in which a dedicated path is reserved for the communication.

Question 13 [4 marks]

Searching and Sorting Algorithms

The list [5, 1, 4, 2] is sorted using a bubble sort, comparing and swapping adjacent elements from the start of the list to the end on each pass, stopping once a complete pass makes no swaps.

State the number of swaps made during the first pass and the contents of the list after the first pass, and state the total number of passes performed, including the final pass that confirms the list is sorted by making no swaps.

Question 14 [5 marks]

Linear Data Structures

A priority queue is implemented as a list kept sorted from highest priority to lowest, where a higher number means a higher priority. Inserting a new item finds its correct position and shifts lower-priority items along to make room.

The priority queue currently holds, from front to back: TaskA (priority 5), TaskB (priority 3), TaskC (priority 1).

insert(TaskD, 4) is called. State the position TaskD is inserted into, and the complete contents of the priority queue afterwards.

Question 15 [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 16 [5 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, 6 -> 14 -> 21 -> 35, with a head pointer to the node holding 6.

Describe, as a sequence of steps, how the node holding 21 is removed so the list becomes 6 -> 14 -> 35. You do not need to write code.

Question 17 [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 = 0, C = 1; A = 0, B = 1, C = 1; and A = 1, B = 1, C = 1. 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 18 [4 marks]

Computer Architecture and the CPU

A processor without pipelining takes 4 clock cycles to fully process one instruction, and cannot start a new instruction until the previous one finishes.

A pipelined version of the same processor splits execution into 4 equal stages, so that once the pipeline is full, one instruction completes every clock cycle.

Calculate the number of clock cycles needed to fully process 10 instructions, without pipelining and with pipelining (assume the first instruction takes 4 cycles to complete, then one further instruction completes each following cycle).

State one hazard that can reduce the benefit of pipelining.

Question 19 [4 marks]

Data Representation

ASCII uses 7 bits to represent 128 characters, covering the basic English alphabet, digits and some punctuation and control characters. Unicode aims to represent characters from every writing system in the world, and is commonly encoded using UTF-8, a variable-length encoding using 1 to 4 bytes per character.

Explain one limitation of ASCII that Unicode addresses, and explain why UTF-8 is described as backward compatible with ASCII.

Question 20 [6 marks]

Linear Data Structures

A queue can be implemented using two stacks, inStack and outStack. To enqueue a value, it is pushed onto inStack. To dequeue, if outStack is empty, every item is popped from inStack and pushed onto outStack, and then the top of outStack is popped and returned; if outStack is not empty, its top is popped and returned directly.

Starting with both stacks empty, the operations enqueue(A), enqueue(B), dequeue(), enqueue(C), dequeue() are performed in order.

State the value returned by each dequeue() call.

Question 21 [6 marks]

Searching and Sorting Algorithms

Insertion sort builds a sorted section at the start of a list by inserting each new element into its correct position, shifting larger elements along to make room.

The nearly-sorted list [2, 5, 9, 14, 8, 20] is sorted using insertion sort.

State how many shifts are needed to insert 8 into its correct position within the already-sorted section 2, 5, 9, 14, and explain why insertion sort performs much better on a nearly-sorted list like this than on a list in reverse order, referring to its best-case and worst-case time complexities.

Question 22 [6 marks]

Data Representation

An audio recording is sampled at a rate of 44100 Hz, using a bit depth of 16 bits per sample, in stereo (2 channels).

Calculate the file size, in bytes, of an uncompressed 10-second recording, then in megabytes, using 1 MB = 1,000,000 bytes, giving your megabyte answer to 2 decimal places.

Model solutions

Mark scheme for Question 1 [2 marks]
Question 1[2 marks]
Answer or workingMarks
one valid star advantage, such as isolation of a peripheral cable failure.B1
one valid star disadvantage, such as greater cabling or central switch failure affecting the whole star; do not require both.B1
Final answer: Single peripheral link failure is isolated; central switch failure can affect all attached devices
Mark scheme for Question 2 [2 marks]
Question 2[2 marks]
Answer or workingMarks
X = 0A1
OR producing 1 when at least one input is 1, including bothB1
Final answer: X = 0; OR gives 1 when at least one operand is 1 (including both).
Mark scheme for Question 3 [2 marks]
Question 3[2 marks]
Answer or workingMarks
identifying the first middle element checked as index 3, value 18M1
stating 24 is not found on this first comparison, since 24 is greater than 18 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. The first index and whether it finds the target are requested. Naming the value 18 is optional evidence.A1
Final answer: First middle index is 3 (value 18); 24 is not found on this comparison.
Mark scheme for Question 4 [3 marks]
Question 4[3 marks]
Answer or workingMarks
the address bus - carries the memory address the CPU wants to read from or write toB1
the data bus - carries the actual data being transferred between the CPU and memory (or another device)B1
the control bus - carries control signals, such as read/write signals, that coordinate and synchronise the transferB1
Final answer: Address bus: carries the memory address; data bus: carries the data itself; control bus: carries signals that coordinate the transfer
Mark scheme for Question 5 [3 marks]
Question 5[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 6 [3 marks]
Question 6[3 marks]
Answer or workingMarks
the total number of characters needed: 26 + 10 = 36M1
recognising the number of bits, b, must satisfy 2^b >= 36M1
6 bits, since 2^5 = 32 is not enough but 2^6 = 64 isA1
Final answer: 6 bits (2^5 = 32 is too few, but 2^6 = 64 is enough for 36 characters)
Mark scheme for Question 7 [4 marks]
Question 7[4 marks]
Answer or workingMarks
addFront(3) then addRear(7) giving the deque 3, 7 (front to back)M1
addFront(1) giving the deque 1, 3, 7 (front to back)M1
removeRear() returning 7A1
the final deque contents 1, 3 (front to back) Award all 4 marks for the complete correct requested answer: Front to back: 1, 3. removeRear returns 7. 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: 1, 3. removeRear returns 7.
Mark scheme for Question 8 [1 mark]
Question 8[1 mark]
Answer or workingMarks
stating one valid reason, such as registers being more expensive per byte than RAM or requiring more chip area per byte; either statement alone earns full credit.B1
Final answer: Registers are much more expensive per byte than RAM.
Mark scheme for Question 9 [3 marks]
Question 9[3 marks]
Answer or workingMarks
describing the client's role, such as sending a request for a resource, for example an HTTP request for a pageB1
describing the server's role, such as receiving the request, processing it and returning the requested resourceB1
a valid advantage, such as centralised control and management of data and security, or resources being easier to back up when kept in one placeB1
Final answer: The client requests a resource; the server processes the request and returns it. Client-server gives centralised control of data and security
Mark scheme for Question 10 [3 marks]
Question 10[3 marks]
Answer or workingMarks
choosing the four-core 2.0 GHz processor under the printed assumptions.B1
explaining that independent image files can be processed simultaneously on different cores.B1
explaining that the extra parallel work outweighs the lower per-core clock speed; accept a qualitative comparison or 4 * 2.0 versus 1 * 4.0. A calculated ratio is not required.B1
Final answer: Four-core 2.0 GHz processor; ideal aggregate throughput is twice that of the single 4.0 GHz core under the printed assumptions.
Mark scheme for Question 11 [4 marks]
Question 11[4 marks]
Answer or workingMarks
2 being shifted before 5 to give the sorted section 2, 5M1
9 remaining after 5, since it is already larger, giving the sorted section 2, 5, 9M1
the unsorted elements 1 and 6 remaining unchanged in their original positionsA1
the complete list 2, 5, 9, 1, 6 Award all 4 marks for the complete correct requested answer: [2,5,9,1,6]. 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: [2,5,9,1,6].
Mark scheme for Question 12 [4 marks]
Question 12[4 marks]
Answer or workingMarks
dividing data into labelled packets with routing/sequence information.B1
packets being forwarded independently and potentially following different routes.B1
reassembling the original data at the destination.B1
stating one valid advantage over a reserved circuit, such as more efficient link use or greater resilience to a failed path; no additional explanation or second advantage is required.B1
Final answer: Split into packets; route independently; reassemble; share links without reserving a circuit
Mark scheme for Question 13 [4 marks]
Question 13[4 marks]
Answer or workingMarks
pass one making 3 swaps: swapping 5 and 1, then 5 and 4, then 5 and 2 as 5 moves towards the endM1
the list reading 1, 4, 2, 5 after pass oneA1
pass two making 1 swap (4 and 2), giving 1, 2, 4, 5, and pass three making no swapsM1
stating 3 passes are performed in total, since the third pass confirms the list is sorted by making no swaps Award all 4 marks for the complete correct requested answer: First pass makes 3 swaps, leaving [1,4,2,5]. Total 3 passes, including the third pass with no swaps. 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: First pass makes 3 swaps, leaving [1,4,2,5]. Total 3 passes, including the third pass with no swaps.
Mark scheme for Question 14 [5 marks]
Question 14[5 marks]
Answer or workingMarks
the second positionA1
identifying it as between TaskA and TaskB. Both may be inferred from the complete ordered queue.A1
TaskA(5) followed by TaskD(4)A1
TaskB(3) nextA1
TaskC(1) last. Award all 5 marks for the correct position and complete final queue without intermediate comparisons.A1
Final answer: TaskD is second, between TaskA and TaskB. Final front to back: TaskA(5), TaskD(4), TaskB(3), TaskC(1).
Mark scheme for Question 15 [4 marks]
Question 15[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 16 [5 marks]
Question 16[5 marks]
Answer or workingMarks
traversing from the head until the node holding 14 is reached, the node before 21B1
reading the pointer stored in the node holding 21, which points to the node holding 35B1
setting the pointer of the node holding 14 to point to the node holding 35, skipping over 21B1
the node holding 21 now being unreachable and able to be discardedB1
confirming the list now correctly reads 6, 14, 35 Award all 5 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. Locating the predecessor, bypassing the node and the resulting list are within the requested deletion sequence. Discarding may mean permitting garbage collection; explicit free is not required.B1
Final answer: Locate predecessor 14 and bypass 21 by setting 14.next to 21.next (35). The list is 6 -> 14 -> 35. Reclaim the removed node if the memory model requires it; garbage collection is also valid.
Mark scheme for Question 17 [2 marks]
Question 17[2 marks]
Answer or workingMarks
the unsimplified sum of products (NOT A AND NOT B AND C) OR (NOT A AND B AND C) OR (A AND B AND C), accepting reordered termsM1
C AND (NOT A OR B), or an equivalent minimal expression; no separate derivation is requestedA1
Final answer: Z = ((NOT A) AND (NOT B) AND C) OR ((NOT A) AND B AND C) OR (A AND B AND C) = C AND ((NOT A) OR B).
Mark scheme for Question 18 [4 marks]
Question 18[4 marks]
Answer or workingMarks
10 * 4 = 40 cycles without pipelining.M1
using 4 + (10 - 1) to include pipeline fill and the remaining completions; accept an equivalent timing diagram.M1
13 cycles with pipelining.A1
stating one valid pipeline hazard, such as a data hazard or a control hazard; no explanation is required.B1
Final answer: 40 cycles without pipelining, 13 cycles with pipelining; a data or control hazard can reduce the benefit
Mark scheme for Question 19 [4 marks]
Question 19[4 marks]
Answer or workingMarks
ASCII having insufficient codes for many writing systems.B1
Unicode assigning code points to a much wider set of characters.B1
the ASCII code points 0 to 127 having identical single-byte values in UTF-8.B1
explaining the compatibility consequence: ASCII-only text is valid UTF-8 with unchanged characters.B1
Final answer: Unicode represents many more writing systems; ASCII codes retain identical one-byte UTF-8 values
Mark scheme for Question 20 [6 marks]
Question 20[6 marks]
Answer or workingMarks
inStack holding A then B (bottom to top) after enqueue(A), enqueue(B)M1
the first dequeue() finding outStack empty and transferring both items, giving outStack B then A (bottom to top)M1
the first dequeue() returning A, since A is now on top of outStackA1
enqueue(C) pushing C onto inStack, which the transfer had emptiedM1
the second dequeue() finding outStack not empty (still holding B), so no transfer occursA1
the second dequeue() returning B Award all 6 marks for the complete correct requested answer: The dequeue values are A, then B. 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: The dequeue values are A, then B.
Mark scheme for Question 21 [6 marks]
Question 21[6 marks]
Answer or workingMarks
2 shiftsA1
a count consistent with moving 14 and 9 past 8A1
insertion after 5. The latter two may be inferred from the correct count for the printed section.A1
explaining that nearly sorted data needs few shiftsB1
best-case O(n) on already sorted inputB1
worst-case O(n^2) on reverse order because the shifts sum to 1+2+...+(n-1). Accept equivalent valid complexity explanations; an intermediate comparison trace is not required.B1
Final answer: Two shifts: 14, then 9; insert 8 after 5, producing [2,5,8,9,14,20]. Nearly sorted data needs few shifts. An already sorted list takes O(n) comparisons overall; reverse order requires 1+2+...+(n-1) shifts and O(n^2) time.
Mark scheme for Question 22 [6 marks]
Question 22[6 marks]
Answer or workingMarks
bytes per sample = 16 bits / 8 = 2 bytesM1
bytes per second for one channel = 44100 x 2 = 88200M1
bytes per second for both channels (stereo) = 88200 x 2 = 176400M1
total bytes over 10 seconds = 176400 x 10 = 1764000 bytesA1
converting to megabytes by dividing by 1,000,000M1
1.76 MB (2 decimal places)A1
Final answer: 1,764,000 bytes, 1.76 MB

Build a free practice pack.

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