Final exam
Introduction to Computer Science
Before you start
- 20 questions, drawn at random from a pool of 33.
- Pass mark: 70%. Your final score is 30% practice + 70% exam.
- No time limit, but finish within 3 hours. You can move between questions before you submit.
- Failed? Review the lessons and try again: every attempt gets a new set of questions.
Question 1 of 20Choose one
Which property must every algorithm have?
Question 2 of 20Match the pairs
Match each computational thinking skill with what it means.
Tap an answer, then tap the place where it belongs (or drag it there).
- Decomposition
- Abstraction
- Pattern recognition
- Algorithm design
Question 3 of 20Work it out
Convert the binary number 101010 to decimal.
Question 4 of 20Work it out
What is the largest whole number that can be stored in 6 bits, starting from 0?
Question 5 of 20Fill in the blanks
Fill in the blanks
A group of 8 bits is called a , and it can represent different values.
Question 6 of 20Choose one
Why might text show up as garbled symbols like "é" instead of "é"?
Question 7 of 20Work it out
An uncompressed image is 800 × 600 pixels at 3 bytes per pixel. How many bytes is it?
Question 8 of 20Put in order
Put the levels of the memory hierarchy in order from fastest to slowest.
Drag the items, or use the arrow buttons, to put them in order.
- CPU registers
- SSD
- Hard drive
- CPU cache
- RAM
Question 9 of 20Choose one
During the fetch-decode-execute cycle, what does the program counter hold?
Question 10 of 20True or false
Saving a document copies it from RAM to storage so it survives when the power is turned off.
Question 11 of 20Work it out
Evaluate (1 AND 1) OR (0 AND 1). Give 1 for true or 0 for false.
Question 12 of 20Choose one
Which gate outputs 1 only when its two inputs are different?
Question 13 of 20Fill in the blanks
Fill in the blanks
A half adder adds two bits. Its sum output uses an gate and its carry output uses an gate.
Question 14 of 20Select all that apply
Which tasks does an operating system perform? Select all that apply.
Select all that apply.
Question 15 of 20True or false
An interpreter translates an entire program into an executable file before any of it runs.
Question 16 of 20Sort into groups
Classify each line of pseudocode by its control structure.
Tap an item, then tap its group (or drag it there).
Question 17 of 20Spot the mistake
This pseudocode should label scores of 90 or more as "Excellent," 70 to 89 as "Pass," and below 70 as "Retry." Tap the line that makes some scores get the wrong label.
Question 18 of 20Work it out
Trace: SET total TO 0. FOR EACH n IN [2, 5, 8, 3]: IF n > 4 THEN SET total TO total + n. OUTPUT total. What is the output?
Question 19 of 20Choose one
Which list can binary search be used on directly?
Question 20 of 20Work it out
A sorted list has 1,000,000 items. About how many checks does binary search need in the worst case? (Use floor(log₂ n) + 1.)
Question 21 of 20Choose one
What is the key idea behind merge sort?
Question 22 of 20Match the pairs
Match each code pattern with its typical Big O.
Tap an answer, then tap the place where it belongs (or drag it there).
- Reading list[0]
- One loop over all n items
- A loop over all items inside another loop over all items
- Halving the search range at each step
Question 23 of 20Work it out
An O(n) algorithm takes 3 seconds for 1,000,000 items. About how many seconds will it take for 4,000,000 items?
Question 24 of 20True or false
An algorithm that takes 2n + 1000 steps is classified as O(n).
Question 25 of 20Choose one
What is the value of x after this code runs? let x = 10; if (x > 5) { x = x - 3; } else { x = x + 3; } x = x * 2;
Question 26 of 20Work it out
How many times does this loop body run? for (let i = 1; i <= 20; i += 5) { ... }
Question 27 of 20Spot the mistake
This function should return the first item of an array. Tap the line with the bug.
Question 28 of 20Choose one
A queue receives tasks A, then B, then C. One task is removed. Which one?
Question 29 of 20Match the pairs
Match each internet technology with its role.
Tap an answer, then tap the place where it belongs (or drag it there).
- DNS
- Router
- TCP
- HTTP status 404
Question 30 of 20True or false
Video calls often use UDP rather than TCP because resending late packets would not help a live conversation.
Question 31 of 20Choose one
Why do websites store password hashes instead of the passwords themselves?
Question 32 of 20What would you do?
What would you do?
A company trains a machine learning model to screen job applications, using its hiring decisions from the past 15 years. Most past hires for engineering roles were men. What is the main risk?
Question 33 of 20Work it out