Original English practice with worked guidance. Selected topics only. This is not a complete syllabus, official past-paper collection or predicted exam score. Check your own exam-board specification: these concepts are not certified against a particular board or exam year. Where a question shows a Cambridge 2027 reference, that is a conceptual placement only; no other exam board (such as Edexcel, AQA or OCR) is mapped, so do not assume this covers your board. Content here is written and checked with AI assistance; it has not been approved by an independent teacher or endorsed by any exam board.
160 original questions across 22 selected topic areas. No account or payment required to practise.
Cambridge International AS & A Level Computer Science (9618), examination year 2027: Conceptual alignment to official sources, not exam-board certification. Syllabus mapping and remaining coverage.
6 questions in this topic
Original questions with indicative worked guidance. Selected topics only.
All topics
Original practice in algorithms and complexity; indicative answers for unofficial practice.
6 of 6 questions shown
Loading saved responses
Question 1Hide question3 indicative marks
Trace3 indicative marksNo calculator
Trace a linear search for 7 in [4, 9, 7, 2], scanning left to right and stopping at the first match. State zero-based index and comparison count.
Cambridge 2027: Direct conceptual match
Linear search trace locates zero-based index 2 after three comparisons. The explicitly stated bound is permitted; Cambridge generally uses one-based arrays, not exclusively.
Conceptual placement only, not official Cambridge endorsement or complete syllabus coverage.
Show indicative guidance
Worked guidance
Binary search's efficiency rests on a proof that all values in one half are too small or too large. An unsorted list lacks that property, making the elimination logically unjustified.
Self-marking points
Tick what your working earned. The count is your own self-assessment.
Self-assessed: not counted yet. This question is worth 3 marks.
Examiner tip
Random access helps implementation speed but does not replace the sorted-order precondition.
Question 3Binary-search [3, 7, 11, 15, 19, 23, 27] for 23 with inclusive bounds and mid = floor((low+high)/2), zero-based indexing. Record midpoint indices until found.3 indicative marks
Trace3 indicative marksNo calculator
Binary-search [3, 7, 11, 15, 19, 23, 27] for 23 with inclusive bounds and mid = floor((low+high)/2), zero-based indexing. Record midpoint indices until found.
Cambridge 2027: Direct conceptual match
Midpoints 3 then 5 directly trace binary search with explicit zero-based bounds; not a generic search implementation task.
Conceptual placement only, not official Cambridge endorsement or complete syllabus coverage.
Show indicative guidance
Worked guidance
Initially low=0 and high=6. Since 15 is too small, discard indices through three; the midpoint of four through six is five and matches immediately.
Self-marking points
Tick what your working earned. The count is your own self-assessment.
Self-assessed: not counted yet. This question is worth 3 marks.
Examiner tip
Updating low to mid instead of mid+1 can prevent progress.
Question 4Perform insertion sort on [5, 2, 4, 1], inserting each next item into the sorted prefix. Give the array after each outer pass.3 indicative marks
Trace3 indicative marksNo calculator
Perform insertion sort on [5, 2, 4, 1], inserting each next item into the sorted prefix. Give the array after each outer pass.
Cambridge 2027: Direct conceptual match
Insertion-sort outer states exercise the named A Level sort. Insertion sort is not the AS bubble-sort requirement.
Conceptual placement only, not official Cambridge endorsement or complete syllabus coverage.
Show indicative guidance
Worked guidance
Save the next item, shift larger prefix elements right, then place it in the gap. Each pass grows the sorted prefix by one while preserving the unprocessed suffix.
Self-marking points
Tick what your working earned. The count is your own self-assessment.
Self-assessed: not counted yet. This question is worth 3 marks.
Examiner tip
Report outer-pass states, not just the final sorted list.
Question 5For a positive integer n, an algorithm runs FOR i=1 TO n and inside it FOR j=1 TO i; both loops include their upper bound and increment by 1. It performs one constant-time operation per inner iteration. Derive the operation count and time complexity; evaluate whether doubling n exactly quadruples the count.4 indicative marks
Derive and evaluate4 indicative marksNo calculator
For a positive integer n, an algorithm runs FOR i=1 TO n and inside it FOR j=1 TO i; both loops include their upper bound and increment by 1. It performs one constant-time operation per inner iteration. Derive the operation count and time complexity; evaluate whether doubling n exactly quadruples the count.
Cambridge 2027: Partial conceptual match
Operation-count scaling relates to time complexity, but exact triangular sums and Theta notation extend the explicitly required Big O treatment.
Conceptual placement only, not official Cambridge endorsement or complete syllabus coverage.
Show indicative guidance
Worked guidance
The inner bound depends on i, so the iteration space is triangular, not n by n. Compare the exact polynomial at n and 2n before taking its large-n leading-term approximation.
Self-marking points
Tick what your working earned. The count is your own self-assessment.
Self-assessed: not counted yet. This question is worth 4 marks.
Examiner tip
Asymptotic scaling is not an exact finite-input equality.
Question 6Prove that a left-to-right algorithm storing the largest value seen returns the maximum of a nonempty array. Include initialisation, maintenance and termination, and explain why initialising largest to zero is unsafe.4 indicative marks
Prove and explain4 indicative marksNo calculator
Prove that a left-to-right algorithm storing the largest value seen returns the maximum of a nonempty array. Include initialisation, maintenance and termination, and explain why initialising largest to zero is unsafe.
Cambridge 2027: Board-neutral enrichment
Formal loop-invariant proofs using initialisation/maintenance/termination are not explicitly required; correctness reasoning alone must not be relabelled as full algorithm construction.
Conceptual placement only, not official Cambridge endorsement or complete syllabus coverage.
Show indicative guidance
Worked guidance
The invariant states exactly what the stored value means after each processed element. Starting with an actual member establishes it, comparing one new member preserves it, and exhausting the array proves the postcondition.
Self-marking points
Tick what your working earned. The count is your own self-assessment.
Self-assessed: not counted yet. This question is worth 4 marks.
Examiner tip
A correctness proof needs the nonempty precondition as well as a loop description.