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.

3. 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 a database table?

Please select an answer first.

Correct answer: A

The correct answer is A structured collection of related records organized into rows and columns.

  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: Tables organize related data so records and attributes can be stored, searched, updated, and related.
  3. Check the result: The correct answer is A structured collection of related records organized into rows and columns.

Tables organize related data so records and attributes can be stored, searched, updated, and related.

2. QuestionMultiple choice

What is a primary key in a relational table?

Please select an answer first.

Correct answer: B

The correct answer is A value or combination of values that uniquely identifies each record.

  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: A primary key prevents ambiguity when records are referenced and helps connect related tables.
  3. Check the result: The correct answer is A value or combination of values that uniquely identifies each record.

A primary key prevents ambiguity when records are referenced and helps connect related tables.

3. QuestionMultiple choice

What does a SQL SELECT statement generally do?

Please select an answer first.

Correct answer: C

The correct answer is Retrieves specified data from one or more tables.

  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: SELECT queries retrieve columns and rows based on conditions, joins, grouping, or other query instructions.
  3. Check the result: The correct answer is Retrieves specified data from one or more tables.

SELECT queries retrieve columns and rows based on conditions, joins, grouping, or other query instructions.

4. QuestionMultiple choice

What is encryption?

Please select an answer first.

Correct answer: D

The correct answer is Transforming readable data into a form that requires a key or method to interpret.

  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: Encryption protects confidentiality by making data difficult to read without the appropriate decryption process or key.
  3. Check the result: The correct answer is Transforming readable data into a form that requires a key or method to interpret.

Encryption protects confidentiality by making data difficult to read without the appropriate decryption process or key.

5. QuestionMultiple choice

What is authentication?

Please select an answer first.

Correct answer: A

The correct answer is Verifying that a user, device, or process is who or what it claims to be.

  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: Authentication commonly uses credentials or factors such as passwords, security keys, or biometrics.
  3. Check the result: The correct answer is Verifying that a user, device, or process is who or what it claims to be.

Authentication commonly uses credentials or factors such as passwords, security keys, or biometrics.

6. QuestionMultiple choice

What is authorization?

Please select an answer first.

Correct answer: B

The correct answer is Determining which resources or actions an authenticated user is allowed to access.

  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: Authorization applies permissions after identity has been established.
  3. Check the result: The correct answer is Determining which resources or actions an authenticated user is allowed to access.

Authorization applies permissions after identity has been established.

7. QuestionMultiple choice

What is phishing?

Please select an answer first.

Correct answer: C

The correct answer is A deceptive attempt to obtain information by pretending to be a trustworthy person or organization.

  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: Phishing commonly uses messages, websites, or calls that create urgency and request credentials, payments, or sensitive data.
  3. Check the result: The correct answer is A deceptive attempt to obtain information by pretending to be a trustworthy person or organization.

Phishing commonly uses messages, websites, or calls that create urgency and request credentials, payments, or sensitive data.

8. QuestionMultiple choice

Why are backups important?

Please select an answer first.

Correct answer: D

The correct answer is They provide recoverable copies of data after loss, corruption, hardware failure, or attack.

  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: A backup strategy supports recovery, but backups should be tested, protected, and updated according to the value and change rate of the data.
  3. Check the result: The correct answer is They provide recoverable copies of data after loss, corruption, hardware failure, or attack.

A backup strategy supports recovery, but backups should be tested, protected, and updated according to the value and change rate of the data.

9. QuestionMultiple choice

What is input sanitization?

Please select an answer first.

Correct answer: A

The correct answer is Cleaning or transforming input so dangerous or unintended content is not interpreted as commands or code.

  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: Sanitization helps reduce injection and related risks, but secure systems also use validation, parameterized queries, authorization, and other controls.
  3. Check the result: The correct answer is Cleaning or transforming input so dangerous or unintended content is not interpreted as commands or code.

Sanitization helps reduce injection and related risks, but secure systems also use validation, parameterized queries, authorization, and other controls.

10. QuestionMultiple choice

Why should software collect only the personal data it actually needs?

Please select an answer first.

Correct answer: B

The correct answer is Data minimization reduces privacy risk, storage exposure, and harm if information is misused or breached.

  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: Collecting less sensitive information limits potential impact and supports responsible, purpose-based data practices.
  3. Check the result: The correct answer is Data minimization reduces privacy risk, storage exposure, and harm if information is misused or breached.

Collecting less sensitive information limits potential impact and supports responsible, purpose-based data practices.