Grade 12 Computer Science and Programming Practice Tests

These Grade 12 Computer Science and Programming practice tests build foundations in coding, algorithms, data structures, databases, web development, cybersecurity, artificial intelligence, testing, and responsible technology use.

Skills covered

  • Programming foundations: variables, conditionals, loops, functions, arrays, Boolean values, tracing, syntax errors, pseudocode, and input validation
  • Algorithms and data structures: binary representation, algorithms, complexity, recursion, stacks, queues, sorting, searching, abstraction, and modularity
  • Data and security: tables, primary keys, SQL retrieval, encryption, authentication, authorization, phishing, backups, sanitization, and data minimization
  • Web and software development: HTML, CSS, APIs, client-server systems, version control, unit testing, documentation, accessibility, responsive design, and deployment
  • Computational thinking and AI: training data, algorithmic bias, ethics, debugging, decomposition, pattern recognition, trade-offs, open source, and project reflection

How to use these practice tests

Trace each step carefully, define the data or system concept, and consider what the program or technology should do under the stated conditions. When questions involve real users, include security, accessibility, privacy, and ethical effects in your reasoning.

For more Grade 12 preparation, return to the College and Career Preparation category.

4. Test

Grade 12 Computer Science and Programming Practice Tests

Practice Grade 12 Computer Science and Programming questions about code, algorithms, data structures, databases, web development, security, artificial intelligence, and software projects.

Choose the best answer. Trace the logic, identify the system or data concept, and consider reliability, security, accessibility, and ethical effects where relevant.

10 Questions
0/10 Questions0 %
Correct 0
Incorrect 0
Unanswered 10
1. QuestionMultiple choice

What is HTML primarily used for?

Please select an answer first.

Correct answer: A

The correct answer is Structuring the content and elements of a web page.

  1. Identify the computer science concept: Determine whether the question concerns programming, algorithms, data structures, systems, web development, security, data, artificial intelligence, or ethics.
  2. Trace the logic or principle: HTML defines page structure such as headings, paragraphs, links, lists, forms, and other elements.
  3. Check the result: The correct answer is Structuring the content and elements of a web page.

HTML defines page structure such as headings, paragraphs, links, lists, forms, and other elements.

2. QuestionMultiple choice

What is CSS primarily used for?

Please select an answer first.

Correct answer: B

The correct answer is Controlling the presentation, layout, and visual style of web content.

  1. Identify the computer science concept: Determine whether the question concerns programming, algorithms, data structures, systems, web development, security, data, artificial intelligence, or ethics.
  2. Trace the logic or principle: CSS controls properties such as color, spacing, typography, positioning, and responsive layout.
  3. Check the result: The correct answer is Controlling the presentation, layout, and visual style of web content.

CSS controls properties such as color, spacing, typography, positioning, and responsive layout.

3. QuestionMultiple choice

What is an API?

Please select an answer first.

Correct answer: C

The correct answer is A defined interface that allows software systems or components to communicate and request services or data.

  1. Identify the computer science concept: Determine whether the question concerns programming, algorithms, data structures, systems, web development, security, data, artificial intelligence, or ethics.
  2. Trace the logic or principle: APIs specify available operations, inputs, outputs, and communication rules so systems can interact predictably.
  3. Check the result: The correct answer is A defined interface that allows software systems or components to communicate and request services or data.

APIs specify available operations, inputs, outputs, and communication rules so systems can interact predictably.

4. QuestionMultiple choice

In a client-server model, what does the server generally do?

Please select an answer first.

Correct answer: D

The correct answer is Provides requested resources or services and responds to client requests.

  1. Identify the computer science concept: Determine whether the question concerns programming, algorithms, data structures, systems, web development, security, data, artificial intelligence, or ethics.
  2. Trace the logic or principle: Servers can store data, run application logic, authenticate users, and return responses to clients.
  3. Check the result: The correct answer is Provides requested resources or services and responds to client requests.

Servers can store data, run application logic, authenticate users, and return responses to clients.

5. QuestionMultiple choice

What is version control used for?

Please select an answer first.

Correct answer: A

The correct answer is Tracking changes to files so developers can collaborate, review history, and restore earlier versions.

  1. Identify the computer science concept: Determine whether the question concerns programming, algorithms, data structures, systems, web development, security, data, artificial intelligence, or ethics.
  2. Trace the logic or principle: Version control supports collaboration, branching, review, rollback, and an auditable history of changes.
  3. Check the result: The correct answer is Tracking changes to files so developers can collaborate, review history, and restore earlier versions.

Version control supports collaboration, branching, review, rollback, and an auditable history of changes.

6. QuestionMultiple choice

What is a unit test?

Please select an answer first.

Correct answer: B

The correct answer is A test that checks a small, isolated component of a program.

  1. Identify the computer science concept: Determine whether the question concerns programming, algorithms, data structures, systems, web development, security, data, artificial intelligence, or ethics.
  2. Trace the logic or principle: Unit tests help detect defects in individual functions or components before larger integration tests.
  3. Check the result: The correct answer is A test that checks a small, isolated component of a program.

Unit tests help detect defects in individual functions or components before larger integration tests.

7. QuestionMultiple choice

Why is technical documentation important?

Please select an answer first.

Correct answer: C

The correct answer is It explains how a system works, how to use it, and how to maintain or troubleshoot it.

  1. Identify the computer science concept: Determine whether the question concerns programming, algorithms, data structures, systems, web development, security, data, artificial intelligence, or ethics.
  2. Trace the logic or principle: Documentation transfers knowledge, reduces confusion, supports onboarding, and makes maintenance more reliable.
  3. Check the result: The correct answer is It explains how a system works, how to use it, and how to maintain or troubleshoot it.

Documentation transfers knowledge, reduces confusion, supports onboarding, and makes maintenance more reliable.

8. QuestionMultiple choice

What does web accessibility seek to provide?

Please select an answer first.

Correct answer: D

The correct answer is Usable access to digital content and functions for people with different abilities and technologies.

  1. Identify the computer science concept: Determine whether the question concerns programming, algorithms, data structures, systems, web development, security, data, artificial intelligence, or ethics.
  2. Trace the logic or principle: Accessibility can involve keyboard support, meaningful structure, text alternatives, contrast, captions, labels, and flexible interaction.
  3. Check the result: The correct answer is Usable access to digital content and functions for people with different abilities and technologies.

Accessibility can involve keyboard support, meaningful structure, text alternatives, contrast, captions, labels, and flexible interaction.

9. QuestionMultiple choice

What does responsive web design mean?

Please select an answer first.

Correct answer: A

The correct answer is A design that adapts layout and content to different screen sizes and devices.

  1. Identify the computer science concept: Determine whether the question concerns programming, algorithms, data structures, systems, web development, security, data, artificial intelligence, or ethics.
  2. Trace the logic or principle: Responsive design uses flexible layouts, media queries, and adaptable elements to support phones, tablets, and larger screens.
  3. Check the result: The correct answer is A design that adapts layout and content to different screen sizes and devices.

Responsive design uses flexible layouts, media queries, and adaptable elements to support phones, tablets, and larger screens.

10. QuestionMultiple choice

What is deployment?

Please select an answer first.

Correct answer: B

The correct answer is Making a software application or update available in its target environment for use.

  1. Identify the computer science concept: Determine whether the question concerns programming, algorithms, data structures, systems, web development, security, data, artificial intelligence, or ethics.
  2. Trace the logic or principle: Deployment moves a tested version into an environment where users or other systems can access it.
  3. Check the result: The correct answer is Making a software application or update available in its target environment for use.

Deployment moves a tested version into an environment where users or other systems can access it.