Uni-Sine
Canadian examsGrade 12

ICS4U exam review: Grade 12 Computer Science practice questions and exam rules

Paper resets in

The daily Grade 12 Computer Science (ICS4U) paper has 8 original questions worth 25 to 35 marks. It is practice for data structures, recursion, object-oriented programming, searching, sorting and complexity. Its SQL, regular expression, finite state machine, networking and floating-point questions go beyond ICS4U, so treat those as extra.

How the ICS4U final evaluation counts in 2026-27

In Grade 12 in Ontario, your final mark is now 65% classroom work, a 25% final evaluation, and 10% attendance and participation. For computer studies, that 25% is a 10% written exam in your board's exam period and a 15% culminating task that your teacher sets. The prerequisite for ICS4U is ICS3U. These figures come from the Ministry of Education's September 2026 update to Growing Success.

What's on the ICS4U exam: the strands

  • A. Programming concepts and skills.
  • B. Software development: including managing a large team project from planning to review.
  • C. Designing modular programs: modular design and fully documented programs.
  • D. Computers and society: ethics, environmental issues, emerging research and careers.
  • Across the course you also analyse algorithms for effectiveness.

ICS4U practice questions with answers

We wrote these for this page. The code is in Python; the ideas carry over to whatever language your class uses.

1. Algorithm analysis. About how many comparisons do a linear search and a binary search need, at most, on a sorted list of 1,000,000 items? Answer: linear search may need all 1,000,000, which is O(n). Binary search halves the list each time and 2²⁰ is just over a million, so it needs at most 20, which is O(log n). Try a halving question from our Search Algorithms course, then press Mark.

Type log base 2 of a list size, or the list size from a number of halvings.

Press Mark to have your answer marked in the Search Algorithms course.

2. Recursion. Write a recursive function that adds the digits of a positive integer, so 4,708 gives 19.

def digit_total(n):
    if n < 10:
        return n
    return n % 10 + digit_total(n // 10)

Answer: the base case handles a single digit, and each call peels off the last digit with % 10 and recurses on the rest with // 10. For 4,708 that is 8 + 0 + 7 + 4 = 19. Without a base case the function would never stop.

3. Sorting. Why is merge sort faster than bubble sort on large lists? Answer: merge sort splits the list in half repeatedly and merges sorted halves, taking about n log n steps. Bubble sort compares neighbours in repeated passes, taking about n² steps in the worst case. For 10,000 items that is roughly 130,000 steps against 100 million. See both in the Algorithm Visualiser.

4. Modular design and classes. Write a bank account class that keeps the balance private and rejects deposits that aren't positive.

class Account:
    def __init__(self, owner):
        self.owner = owner
        self._balance = 0

    def deposit(self, amount):
        if amount <= 0:
            raise ValueError("Deposit must be positive")
        self._balance += amount

    def balance(self):
        return self._balance

Answer: other code changes the balance only through deposit, which checks the input. Hiding data behind methods like this is encapsulation, and it keeps each module responsible for its own rules.

5. Data structures. Push 3, push 5, pop, push 2 onto an empty stack. What is on top? Do the same four operations with a queue (enqueue and dequeue). What is at the front? Answer: the stack is last in, first out: pop removes 5, leaving 2 on top of 3. The queue is first in, first out: dequeue removes 3, leaving 5 at the front, then 2.

Use the daily paper as a practice exam

  1. Open today's ICS4U paper and work to the suggested time, 35 to 40 minutes.
  2. Answer the recursion, object-oriented, data structure and sorting questions; treat the rest as extra.
  3. Rewrite code answers in your class's language.
  4. Mark it and note which strand each lost mark belongs to.

Common ICS4U mistakes

  • Leaving out the base case in recursion.
  • Calling an O(n²) algorithm fast because it works on small tests.
  • Making class data public when it should be changed only through methods.
  • Mixing up stacks and queues.
  • Skipping documentation: ICS4U expects fully documented programs.

Common questions

How is ICS4U evaluated in 2026-27?
Classroom work is 65%, the final evaluation 25% (a 10% written exam and a 15% culminating task), and attendance and participation 10%.
What is the prerequisite for ICS4U?
Introduction to Computer Science, Grade 11, University Preparation (ICS3U).
Are these real ICS4U exam questions?
No. The questions on this page and our daily papers are original.

Revision cards

Test yourself, then flip each card to check.

Where to go next

  • Solve it

    Algorithm Visualiser

    Watch sorting and pathfinding algorithms run step by step

    Open the tool
  • Learn it

    Search Algorithms

    Linear, binary, depth-first and beyond: find data fast with the right algorithm

    Start the course
  • Test it

    Grade 12 Computer Science (ICS4U)

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
Read next
Canada · Grade 12SCH4U Practice Exam: Grade 12 Chemistry Questions, AnswersAn SCH4U practice exam: free Grade 12 Chemistry questions on organic, structure, calorimetry, equilibrium and cells, and how the 2026-27 exam counts.