S5 ICT: Programming Arrays and Functions – Practice Paper 3 (Challenge, 10 Questions)
- 2026-11-05
S5 ICT: Programming Arrays and Functions – Practice Paper 3 (Challenge, 10 Questions)
Paper three tackles recursion and call counts, two-dimensional indices, selection sort comparisons, the binary search upper bound, off-by-one loop bounds and variable scope.
Quick answer Challenge items test boundaries and call counts: recursion needs a base case, loops need correct first and last indices, and one step off ruins everything.
01 Paper details (check answers afterwards)
| Item | Detail |
|---|---|
| Questions | 10 questions |
| Suggested time | 25 minutes |
| Difficulty mix | Foundation 1 · Intermediate 2 · Challenge 3 · Error redo 4 |
| Chapter | Chapter: S5 ICT | Programming: Arrays and Functions |
| Level | Challenge |
02 Questions (10 items)
- FoundationA recursive function factorial(n) returns 1 when n is 1, otherwise n times factorial(n-1). What is factorial(5)?
- IntermediateGiven fib(1)=1 and fib(2)=1, and fib(n)=fib(n-1)+fib(n-2) otherwise, what is fib(6)?
- IntermediateA two-dimensional array is declared with 3 rows and 4 columns. How many elements are there, and what is the index of the last one?
- ChallengeA selection sort runs on an array of 6 elements. How many comparisons does it make in total?
- ChallengeA binary search runs on the sorted values 1 to 100. What is the maximum number of comparisons?
- ChallengeWhile factorial(5) runs, how many times is the function called in total, including the first call?
- Error redoA loop is written FOR i = 1 TO 5 but should be FOR i = 0 TO 4. Which element is missed when summing A, and by how much is the total short?
- Error redoA local variable x inside a function changes from 5 to 9 while a variable of the same name outside stays 5. What is this called?
- Error redoAn array of length 6 is reversed. Which element is swapped with A[0]?
- Error redoAmong 100 elements, how many comparisons do linear search and binary search need in the worst case?
03 Answers and one-line notes
| # | Answer | One-line note |
|---|---|---|
| 1 | 120 | 5 times 4 times 3 times 2 times 1 equals 120. |
| 2 | 8 | The sequence is 1, 1, 2, 3, 5, 8, so the sixth term is 8. |
| 3 | 12 elements, at index [2][3]. | 3 times 4 equals 12, with row indices 0 to 2 and column indices 0 to 3. |
| 4 | Fifteen. | 6 times 5 divided by 2 equals 15, as each pass selects the smallest remaining value. |
| 5 | Seven. | 2 to the power 6 is 64 and 2 to the power 7 is 128, so at most 7 comparisons are needed. |
| 6 | Five times. | The calls step down from factorial(5) to factorial(1), so there are 5 in total. |
| 7 | A[0]=12 is missed, so the total becomes 53 instead of 65. | An off-by-one boundary drops the first element, the most common shift error in tracing. |
| 8 | The scope of a local variable is limited to the function. | The local variable disappears when the function ends, so the outside variable is unaffected. |
| 9 | A[5]. | Symmetric positions add up to the length minus 1, so index 0 pairs with index 5. |
| 10 | Linear 100; binary 7. | Binary search halves the range each time, so 7 comparisons cover 100 elements. |
04 What to do after marking
- After marking, redo only the wrong items and write down which step went wrong (formula, unit, or misread number).
- Repeat the same item two days later; move to the next paper only when both attempts are correct.
- Parents only need the answer and note columns; there is no need to explain every item.
Find a tutor freeTutor Registration →
Questions and answers are written originally by the TutorZone team and are not taken from any school, publisher or examination authority paper. Every value is checked by computer.


