Get matched
AS & A Level · AS/A Level

Computer Science

Programming and computer systems

Name: ____________________Date: October 10, 2026
  1. 1.

    Trace this pseudocode: total <- 0; FOR i <- 1 TO 4 inclusive: total <- total + i*i; OUTPUT total. State the output and the time complexity if the upper limit is n.

    [3 marks] · no calculator
  2. 2.

    Define f(n): IF n = 0 RETURN 1; ELSE RETURN n*f(n - 1). For integer n >= 0, find f(4), explain the base case and state the extra stack-space complexity.

    [4 marks] · no calculator
  3. 3.

    A tutoring app has one remaining seat. Two users both read seats = 1, then each confirms a booking and writes seats = 0. Explain the fault and propose a database-level solution that prevents overbooking.

    [4 marks] · no calculator