WACE Computer Science study materials
WACE Computer Science study resources

WACE Computer Science practice questions

One question at a time. Build your WACE Computer Science understanding.

First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.

Continue in the practice tool above to load more questions, 50 at a time.

Question 1Computer Science

Which number base do digital computers primarily use to represent data internally?

  1. Base 16
  2. Base 2 Correct answer.
  3. Base 10
  4. Base 8

Explanation

Digital circuits have two stable voltage states, so data is stored and manipulated in binary (base 2). Octal and hexadecimal are only shorthand notations used by humans to read binary more compactly.

Question 2Computer Science

What is the decimal value of the binary number 1011?

  1. 9
  2. 11 Correct answer.
  3. 15
  4. 13

Explanation

Each position represents a power of two: 8 + 0 + 2 + 1 equals 11. The leftmost bit contributes 8 and the two rightmost bits contribute 2 and 1.

Question 3Computer Science

In a truth table, what is the output of an AND gate when both inputs are 1?

  1. Undefined
  2. Alternating
  3. 1 Correct answer.
  4. 0

Explanation

An AND gate outputs 1 only when every input is 1, so two high inputs produce a high output. If any input is 0 the output becomes 0.

Question 4Computer Science

Which data structure follows a last-in, first-out order?

  1. Linked list
  2. Queue
  3. Stack Correct answer.
  4. Array

Explanation

A stack pushes and pops from the same end, so the most recently added item leaves first. This last-in, first-out behaviour is its defining property.

Question 5Computer Science

What does the fetch stage of the fetch-decode-execute cycle do?

  1. Writes the result back to main memory
  2. Loads the next instruction from memory into the CPU Correct answer.
  3. Performs the arithmetic requested by the instruction
  4. Translates source code into machine code

Explanation

Fetch retrieves the instruction pointed to by the program counter and places it in the instruction register. Decoding and execution happen in later stages of the cycle.

Question 6Computer Science

Which of these is an example of system software?

  1. Web browser
  2. Photo editor
  3. Operating system Correct answer.
  4. Spreadsheet application

Explanation

System software manages hardware and provides a platform for other programs; an operating system is the primary example. Applications such as browsers and editors are user-facing productivity tools.

Question 7Computer Science

In a relational database, what is a primary key?

  1. A field that uniquely identifies each record in a table Correct answer.
  2. A field that may contain duplicate values
  3. The first column created in a table
  4. A field that links two tables together

Explanation

A primary key enforces uniqueness and non-null values so every row can be identified distinctly. A field linking two tables is a foreign key instead.

Question 8Computer Science

Which protocol is used to transfer web pages between a browser and a web server?

  1. SMTP
  2. DNS
  3. HTTP Correct answer.
  4. FTP

Explanation

HTTP defines how browsers request resources and how servers respond with web content. The other protocols serve different purposes such as mail, file transfer, or name resolution.

Question 9Computer Science

What is the result of adding the binary numbers 0110 and 0011?

  1. 1111
  2. 1001 Correct answer.
  3. 1010
  4. 0101

Explanation

Adding 6 and 3 gives 9, which is 1001 in binary. The ones column carries into the eights place because 1 + 1 exceeds the bit value.

Question 10Computer Science

A program uses a loop to search a sorted list of 1000 items by repeatedly halving the search range. Roughly how many comparisons are needed in the worst case?

  1. About 500
  2. About 100
  3. About 1000
  4. About 10 Correct answer.

Explanation

Binary search halves the range each step, so the worst case is about log base 2 of 1000, which is roughly 10. Linear scanning would require up to 1000 comparisons.

Question 11Computer Science

Which Boolean expression is equivalent to the NAND of inputs A and B?

  1. A OR B
  2. NOT (A AND B) Correct answer.
  3. A AND NOT B
  4. NOT (A OR B)

Explanation

NAND means negating the AND result, so it is written as NOT (A AND B). It outputs 0 only when both inputs are 1.

Question 12Computer Science

What is the main advantage of a compiler over an interpreter?

  1. It executes source code line by line without translation
  2. The translated program usually runs faster after compilation Correct answer.
  3. It requires no source code to run
  4. It always uses less memory during development

Explanation

A compiler translates the whole program into machine code ahead of time, so the resulting executable runs without repeated translation overhead. Interpreters translate at run time, which adds cost per statement.

Question 13Computer Science

In a computer network, what is the purpose of a router?

  1. Storing files for local users
  2. Assigning domain names to web servers
  3. Converting analogue signals to digital form
  4. Forwarding packets between different networks Correct answer.

Explanation

A router examines destination addresses and forwards packets along paths between separate networks. Devices such as switches and servers handle local delivery and storage instead.

Question 14Computer Science

Which SQL clause is used to filter rows returned by a query?

  1. WHERE Correct answer.
  2. ORDER BY
  3. JOIN
  4. GROUP BY

Explanation

The WHERE clause specifies a condition that each row must satisfy to appear in the result set. The other clauses sort, aggregate, or combine tables rather than filter individual rows.

Question 15Computer Science

A student stores a colour as three bytes, one each for red, green, and blue. How many distinct colours can be represented?

  1. 16,777,216 Correct answer.
  2. 24
  3. 65,536
  4. 256

Explanation

Each byte offers 256 values, so three bytes give 256 cubed, which equals 16,777,216 combinations. This is the familiar 24-bit true colour range.

Question 16Computer Science

What is the effect of a single-bit error during data transmission?

  1. One binary digit is inverted Correct answer.
  2. The message order is reversed
  3. An entire byte is deleted
  4. The checksum always doubles

Explanation

A single-bit error flips exactly one bit from 0 to 1 or from 1 to 0 because of noise or interference. Detecting it relies on redundancy schemes such as parity or checksums.

Question 17Computer Science

Which statement best describes the role of an operating system's scheduler?

  1. It translates high-level code into assembly
  2. It stores files in directories on disk
  3. It manages physical network cabling
  4. It decides which ready process runs on the CPU next Correct answer.

Explanation

The scheduler chooses among processes that are ready to run and allocates CPU time according to a policy such as round robin. File organisation and code translation belong to other subsystems.

Question 18Computer Science

What does the acronym HTML describe?

  1. A protocol for secure data transfer
  2. A programming language for system scripts
  3. A markup language for structuring web content Correct answer.
  4. A database query language

Explanation

HTML is a markup language that uses tags to describe the structure and meaning of web page content. It is not a general-purpose programming language or a transfer protocol.

Question 19Computer Science

A function calls itself with a smaller input until a base case is reached. What is this technique called?

  1. Encapsulation
  2. Recursion Correct answer.
  3. Iteration
  4. Polymorphism

Explanation

Recursion solves a problem by having a function invoke itself on a reduced version of the input, stopping at a base case. Iteration instead repeats using loops.

Question 20Computer Science

Which sorting algorithm repeatedly compares adjacent items and swaps them if they are out of order?

  1. Quick sort
  2. Insertion sort
  3. Merge sort
  4. Bubble sort Correct answer.

Explanation

Bubble sort makes repeated passes over the list, swapping neighbouring elements that are in the wrong order. Merge and quick sort use divide-and-conquer strategies instead.

Question 21Computer Science

A system uses two's complement with 8 bits. What is the decimal value of 11111111?

  1. -128
  2. 127
  3. -1 Correct answer.
  4. 255

Explanation

In two's complement the leading bit has weight -128, so 11111111 equals -128 + 127, which is -1. Unsigned interpretation would give 255 but ignores the sign convention.

Question 22Computer Science

A hash function maps keys to a fixed-size table. What happens when two different keys map to the same slot?

  1. The table automatically doubles in size
  2. A collision occurs and must be resolved by chaining or probing Correct answer.
  3. The first key is converted to a string
  4. The second key is silently discarded

Explanation

When distinct keys hash to the same index a collision arises, and the structure must handle it, for example by storing a list per slot or probing for another free slot. Simply discarding data would lose valid entries.

Question 23Computer Science

A network uses a subnet mask of 255.255.255.192. How many usable host addresses are available in each subnet?

  1. 64
  2. 126
  3. 62 Correct answer.
  4. 30

Explanation

The mask leaves six host bits, giving 64 addresses per subnet. Subtracting the network and broadcast addresses leaves 62 usable host addresses.

Question 24Computer Science

A recursive algorithm solves a problem of size n by splitting it into two halves and doing linear work to combine the results. Which recurrence describes its time complexity?

  1. T(n) = T(n-1) + O(n)
  2. T(n) = 2T(n-1) + O(1)
  3. T(n) = 2T(n/2) + O(n) Correct answer.
  4. T(n) = T(n/2) + O(1)

Explanation

Two subproblems of half the size plus linear combination work gives T(n) = 2T(n/2) + O(n), which solves to O(n log n). The other forms describe binary search, exponential recursion, and quadratic recursion.

Question 25Computer Science

In relational design, which situation most clearly violates third normal form?

  1. Every non-key attribute depends only on the whole primary key
  2. Each table has a single-column primary key
  3. All foreign keys reference existing primary keys
  4. A non-key attribute depends on another non-key attribute Correct answer.

Explanation

Third normal form requires that non-key attributes depend only on candidate keys, so a dependency between two non-key attributes is a transitive dependency and breaks 3NF. The other statements describe conforming or unrelated properties.

Question 26Computer Science

Which number base is used internally by digital computers to represent values?

  1. Binary Correct answer.
  2. Hexadecimal
  3. Octal
  4. Decimal

Explanation

Digital circuits have two stable voltage states, so values are stored and processed as binary digits. Hexadecimal and octal are only compact notations used by humans for convenience.

Question 27Computer Science

In structured programming, which construct repeats a block of statements while a condition remains true?

  1. Selection
  2. Iteration Correct answer.
  3. Declaration
  4. Sequence

Explanation

Iteration is the control construct that repeats statements, either a fixed number of times or while a condition holds. Sequence and selection control order and choice rather than repetition.

Question 28Computer Science

What does a variable's scope determine?

  1. The data type the variable may hold
  2. Where in a program the variable can be referenced Correct answer.
  3. Whether the variable is stored on disk
  4. How many bytes the variable occupies

Explanation

Scope defines the region of a program in which an identifier is visible and can legally be used. It is separate from type, size, and storage location.

Question 29Computer Science

Which type of software is designed to damage, disrupt, or gain unauthorised access to a system?

  1. Freeware
  2. Malware Correct answer.
  3. Firmware
  4. Middleware

Explanation

Malware is the general category for software written with malicious intent, including viruses, worms, and trojans. The other terms describe legitimate roles or licensing models.

Question 30Computer Science

What is the main purpose of a database management system?

  1. To compress files before transmission
  2. To translate domain names into IP addresses
  3. To compile source code into machine code
  4. To store, retrieve, and manage structured data reliably Correct answer.

Explanation

A database management system controls access to stored data, enforces integrity and concurrency rules, and answers queries. It is not concerned with compilation, name resolution, or compression.

Question 31Computer Science

Which addressing mode places the operand directly inside the instruction itself?

  1. Indexed
  2. Indirect
  3. Direct
  4. Immediate Correct answer.

Explanation

In immediate addressing the operand value is encoded in the instruction, so no memory fetch of the operand is needed. The other modes obtain the operand from an address or a computed location.

Question 32Computer Science

Which of these is a characteristic of a solid-state drive rather than a magnetic hard disk?

  1. It has no moving parts Correct answer.
  2. It uses a read/write head on an arm
  3. It requires a defragmentation schedule
  4. It stores data on rotating platters

Explanation

A solid-state drive stores data in flash memory cells, so it has no spinning platters or moving heads. This gives faster random access and greater shock resistance.

Question 33Computer Science

A student needs to convert the decimal number 45 to binary. Which result is correct?

  1. 101011
  2. 100111
  3. 101101 Correct answer.
  4. 110101

Explanation

Subtracting the place values 32, 8, 4 and 1 from 45 leaves nothing, giving 32+8+4+1 = 45, which is written 101101. Checking by place value confirms the other bit patterns give different totals.

Question 34Computer Science

A colour image is 200 pixels wide and 150 pixels high, using 24 bits per pixel with no compression. What is the file size in bytes?

  1. 30 000
  2. 720 000
  3. 180 000
  4. 90 000 Correct answer.

Explanation

The image contains 200 x 150 = 30 000 pixels, and 24 bits is 3 bytes per pixel, so 30 000 x 3 = 90 000 bytes. Dividing the bit total by eight converts bits to bytes.

Question 35Computer Science

A logic circuit outputs 1 only when exactly one of its two inputs is 1. Which gate is it?

  1. AND
  2. NOR
  3. OR
  4. XOR Correct answer.

Explanation

The exclusive-OR gate outputs 1 when the inputs differ and 0 when they are the same, matching exactly-one-true behaviour. AND, OR and NOR all respond differently to the 1,1 input case.

Question 36Computer Science

A linear search examines each item of a list of n items in turn. What is its worst-case time complexity?

  1. O(log n)
  2. O(n) Correct answer.
  3. O(1)
  4. O(n squared)

Explanation

In the worst case the target is absent or last, so every one of the n items is inspected once. The work therefore grows in direct proportion to the list length.

Question 37Computer Science

Which statement about a relational foreign key is correct?

  1. It must always contain a unique value in every row
  2. It references a candidate key in another table to enforce referential integrity Correct answer.
  3. It uniquely identifies each row in its own table
  4. It stores the result of a calculated query

Explanation

A foreign key is an attribute whose values must match a candidate key in a related table, which prevents orphaned records. The same value may legitimately repeat across many rows.

Question 38Computer Science

In a client-server model, which task is performed by the client?

  1. Enforcing access rules for all connected users
  2. Scheduling requests from every other machine
  3. Formatting and displaying responses to the user Correct answer.
  4. Storing the authoritative copy of shared data

Explanation

The client requests services and presents results in a form the user can interpret, such as rendering a page. Authoritative storage and global access control belong to the server.

Question 39Computer Science

A programmer writes a function that receives a list and accidentally modifies it, changing the caller's data. Which concept explains this behaviour?

  1. Using a local constant
  2. Declaring the list as immutable
  3. Passing the list by reference Correct answer.
  4. Passing the list by value

Explanation

When a reference to the list is passed, the function operates on the same underlying object, so changes are visible to the caller. Passing by value would give the function a copy instead.

Question 40Computer Science

Which activity belongs to the maintenance phase of the software development life cycle?

  1. Correcting defects found after release Correct answer.
  2. Writing the initial unit tests
  3. Gathering requirements from stakeholders
  4. Designing the database schema

Explanation

Maintenance covers changes made once software is deployed, including defect correction, adaptation, and enhancement. Requirements, design, and initial testing occur earlier in the cycle.

Question 41Computer Science

A user types a web address. Which sequence correctly describes how the request reaches the web server?

  1. Domain name resolved after the page content is received by the browser
  2. Connection opened to a default address, then the domain name resolved by the server
  3. Web page downloaded, then the domain name resolved, then a connection opened
  4. Domain name resolved to an IP address, then a connection is opened to that address Correct answer.

Explanation

The browser must first translate the domain name into an IP address, then establish a connection to that address before any content can be requested. Resolution therefore precedes connection and download.

Question 42Computer Science

A programmer needs to store a yes/no flag for each of 64 settings as compactly as possible. Which approach uses the least memory?

  1. A list of 64 floating-point numbers
  2. Sixty-four separate Boolean variables
  3. One 64-bit integer used as a bitmask Correct answer.
  4. An array of 64 strings

Explanation

A single 64-bit integer holds one bit per setting, so all 64 flags fit in eight bytes. Separate variables or larger types consume far more space for the same information.

Question 43Computer Science

A program contains a loop whose condition is never updated inside the loop body. What is the most likely consequence?

  1. The loop executes exactly once
  2. The loop terminates immediately
  3. The loop runs forever unless interrupted Correct answer.
  4. The compiler rejects the program

Explanation

If nothing in the body changes the condition, the test keeps producing the same result and the loop never exits. Such an infinite loop continues until externally halted.

Question 44Computer Science

A company stores customer records and wants to ensure that no two customers share the same email address. Which constraint should be applied?

  1. A unique constraint on the email column Correct answer.
  2. A foreign key on the email column
  3. An index on the customer name column
  4. A default value for the email column

Explanation

A unique constraint rejects any insert or update that would duplicate an existing value in that column. Defaults, foreign keys and unrelated indexes do not prevent duplicate emails.

Question 45Computer Science

A program must swap the values held in two variables using a temporary variable. Which order of operations is correct?

  1. temp = a; a = b; b = temp Correct answer.
  2. temp = a; b = temp; a = b
  3. a = b; b = a; temp = b
  4. a = b; temp = a; b = temp

Explanation

Saving a into the temporary first preserves it, then a receives b, and finally b receives the saved original value. Any order that overwrites a before saving it loses the original.

Question 46Computer Science

An algorithm's running time is described as O(n log n). Doubling the input size roughly does what to the running time?

  1. Leaves it unchanged
  2. Slightly more than doubles it Correct answer.
  3. Doubles it
  4. Squares it

Explanation

Replacing n with 2n gives 2n(log n + 1), which is a little more than twice n log n because of the added logarithmic term. Growth is therefore slightly above proportional.

Question 47Computer Science

A cache holds four slots and uses direct mapping with the slot chosen by the lowest two bits of the address. Addresses 5, 9 and 13 are accessed in that order. What happens?

  1. Only the first address is ever stored
  2. Each access evicts the previous entry because all map to the same slot Correct answer.
  3. The cache rejects addresses above 8
  4. All three occupy different slots and no eviction occurs

Explanation

The lowest two bits of 5, 9 and 13 are all 01, so all three map to slot 1 and each new access replaces the previous entry. This is the classic direct-mapped conflict pattern.

Question 48Computer Science

A relation is in second normal form and has no transitive dependencies, but a non-key attribute depends on part of a composite key. Which normal form does it fail to satisfy?

  1. Fourth normal form
  2. Third normal form
  3. Second normal form Correct answer.
  4. First normal form

Explanation

Second normal form requires every non-key attribute to depend on the whole composite key, not just part of it. A partial dependency therefore violates second normal form even when transitive dependencies are absent.

Question 49Computer Science

A recursive function computes the nth Fibonacci number by calling itself twice with no memoisation. Why does its running time grow exponentially?

  1. The same subproblems are recomputed many times across separate branches Correct answer.
  2. The base case is never reached for large inputs
  3. Recursion always requires exponential stack space per call
  4. Each call performs a constant number of operations on a growing array

Explanation

Without memoisation, each call spawns two more and identical subproblems are solved repeatedly in different branches. The number of calls therefore grows roughly with the golden ratio raised to n.

Question 50Computer Science

A network administrator must divide a class C address block into subnets that each support at least 50 usable hosts. Which subnet mask is the smallest that satisfies the requirement?

  1. 255.255.255.240
  2. 255.255.255.224
  3. 255.255.255.128
  4. 255.255.255.192 Correct answer.

Explanation

A /26 mask leaves six host bits, giving 64 addresses and 62 usable hosts, which meets the requirement with the least waste. The /25 mask wastes more addresses while the /27 and /28 masks fall short of 50 hosts.