← TEJ3M Computer Engineering
TEJ3M · Exam review
Computer Engineering Exam Review
A practice exam with questions from all 7 units, then the key facts from every lesson, unit by unit. For a deeper look at one unit, open its test review.
Unit test reviews
Practice exam
35 questions, the same number from each unit. Each one shows the lesson it comes from.
- Unit 1: The Computer System Model1Which component belongs to the PROCESS stage rather than to input, output or storage?
- Unit 1: Binary, Decimal and Hexadecimal2Convert to decimal.
- Unit 1: Representing Data: Bits, Bytes and Files3An image is 800 × 600 pixels at 16-bit colour. What is its size in bytes?bytes
- Unit 1: Representing Data: Bits, Bytes and Files4How many bits are in 3 KiB? (1 KiB = 1024 bytes)bits
- Unit 1: Generations, Moore's Law and Where Hardware Is Going5Match each trend to its description.Cloud computingEdge computingInternet of ThingsQuantum computing
- Unit 2: The CPU and the Motherboard6Which register holds the address of the next instruction to be fetched?
- Unit 2: Memory and Storage7Order these from fastest access time to slowest.
- 1L2 cache
- 2Hard disk drive
- 3Main memory (DRAM)
- 4CPU register
- Unit 2: Building a System and Connecting Peripherals8Which of these can safely be connected while the computer is running?
- Unit 2: Firmware, POST and the Boot Sequence9A technician changes SATA mode from AHCI to RAID in firmware on a working Windows machine. What happens next?
- Unit 2: Operating Systems, File Systems and Maintenance10A file system uses 4 KB blocks. How many blocks does a 10 000 byte file occupy? (Blocks cannot be shared between files.)blocks
- Unit 3: Network Types, Topologies and Media11Which best describes the difference between a LAN and a WAN?
- Unit 3: The OSI and TCP/IP Models12Order the OSI layers from layer 1 to layer 4.
- 1Data link
- 2Transport
- 3Network
- 4Physical
- Unit 3: IP Addressing and Subnetting13How many usable host addresses does a /27 subnet provide?
- Unit 3: IP Addressing and Subnetting14Two hosts are 10.1.1.5/24 and 10.1.2.5/24 with no router between them. Can they communicate?
- Unit 3: Network Devices, Cabling and Security15Why must you avoid untwisting more than about 13 mm of each pair when terminating UTP?
- Unit 4: Voltage, Current, Resistance and Power16A 330 Ω resistor has 5 V across it. What current flows, in milliamps?mA
- Unit 4: Components and Schematic Diagrams17Why must an LED never be connected directly across a supply?
- Unit 4: Series, Parallel and Voltage Dividers18In a series circuit with a 100 Ω and a 900 Ω resistor across 10 V, how is the voltage shared?
- Unit 4: Logic Gates and Truth Tables19Why must an unused input on a CMOS logic chip be tied high or low?
- Unit 4: Boolean Algebra and Simplification20Order these simplification steps for .
- 1Apply the complement law to
- 2Verify the result with a truth table
- 3Apply the identity law to
- 4Factor out the common variable A
- Unit 5: Variables, Data Types and Input/Output21What does
input()return when the user types 42? - Unit 5: Selection: if, elif and else22This chain is written as
if m >= 50:Pass,elif m >= 80:Excellent. What does a mark of 85 print? - Unit 5: Loops: while and for23Where must an accumulator be initialized?
- Unit 5: Lists and Strings24Which loop correctly adds 5 to every mark in a list, modifying the list itself?
- Unit 5: Functions, Errors and Debugging25Why is it better for a function to
returna value than toprintit? - Unit 6: Microcontrollers and the Arduino26Which function runs only once when an Arduino is powered on?
- Unit 6: Digital Input and Output27A button is wired between a pin and 5 V with no other components. What does the pin read when the button is NOT pressed?
- Unit 6: Analog Inputs and Sensors28
analogRead()returns 512. What voltage is on the pin? Answer in volts to 2 decimal places.V - Unit 6: Analog Inputs and Sensors29What is the smallest voltage change an Uno's 10-bit ADC can detect across a 5 V range? Answer in millivolts, to 1 decimal place.mV
- Unit 6: PWM, Motors and Control Systems30Match each component to its role in a motor circuit.TransistorFlyback diodeH-bridgeCommon ground
- Unit 7: Environmental Impact and E-Waste31For a typical laptop, which stage of its lifecycle consumes the most energy?
- Unit 7: Environmental Impact and E-Waste32What must be done to a hard drive before donating a computer?
- Unit 7: Societal Impact, Ethics and Security33Which measure most reduces the risk of a successful attack on a typical organization?
- Unit 7: Workplace Safety, Standards and Careers34What does WHMIS stand for?
- Unit 7: Workplace Safety, Standards and Careers35What is the correct handling of a soldering iron between joints?
Key facts by unit
Unit 1: Introduction to Computers
The Computer System Model
- Every computing system is Input → Process → Output, with Storage attached to the process stage.
- RAM is volatile (loses data without power); storage is non-volatile (keeps it).
- Hardware is physical; software is instructions; firmware is software stored permanently in hardware.
- System software manages the machine; application software does a user's task.
- Von Neumann architecture: one memory holds both instructions and data — the stored-program concept.
Binary, Decimal and Hexadecimal
- Binary place values from the right: — doubling each time.
- An -bit number can represent different values, from to .
- One byte = 8 bits = values 0 to 255 = exactly two hex digits.
- Four bits = one hex digit, always. is the reason hex exists.
- Decimal → binary: divide by 2 repeatedly and read the remainders BOTTOM to TOP.
- Hex digits above 9: A=10, B=11, C=12, D=13, E=14, F=15.
Representing Data: Bits, Bytes and Files
- 8 bits = 1 byte. Lowercase b means bits, uppercase B means bytes.
- 1 KiB = 1024 B, but 1 kB = 1000 B. Drive makers use the second; operating systems often label the first as "GB".
- ASCII: 'A' = 65, 'a' = 97, '0' = 48. The gap between upper and lower case is always 32.
- Image size in bits = width × height × colour depth; divide by 8 for bytes.
- -bit colour depth gives colours; 24-bit gives 8 bits per RGB channel = 16.7 million.
- Lossless compression is reversible; lossy compression permanently discards data.
Generations, Moore's Law and Where Hardware Is Going
- The four generations are defined by their switching device: vacuum tube → transistor → integrated circuit → microprocessor.
- Moore's law: transistors on an economical chip double roughly every two years. It is an economic observation, not a physical law.
- Clock speeds plateaued near 3–4 GHz around 2005 because power and heat rise steeply with frequency.
- The industry responded with more cores, not faster ones — which only helps software written to run in parallel.
- The memory wall: CPU speed outpaced RAM speed, so cache exists to hide the gap.
Unit 2: Hardware, Software and Operating Systems
The CPU and the Motherboard
- The machine cycle is fetch → decode → execute → store, repeated billions of times per second.
- Inside a core: control unit (directs), ALU (calculates), registers (hold the current values).
- The program counter holds the address of the NEXT instruction.
- Three buses: address (where), data (what), control (read or write, and when).
- A 32-bit address bus can address bytes = 4 GiB — the historical 32-bit RAM ceiling.
- Clock speed only compares fairly within one CPU generation; cores, cache and IPC matter as much.
Memory and Storage
- The hierarchy runs registers → L1 → L2 → L3 → RAM → SSD → HDD, getting slower and larger each step.
- Everything above the SSD line is volatile.
- RAM is read-write and volatile; ROM is non-volatile and holds firmware.
- Virtual memory uses drive space as overflow for RAM — it prevents crashes but is about 1000× slower.
- SSDs beat HDDs most dramatically on random access, not on sequential throughput.
- RAID provides availability, not backup.
Building a System and Connecting Peripherals
- Drain residual power by unplugging and holding the power button for five seconds before opening a case.
- A chip can be destroyed by a static charge of about 30 V — far below the ~3000 V you can feel.
- PSU rails: +12 V (CPU and GPU, the main load), +5 V and +3.3 V for logic and drives.
- Size a PSU with roughly 30% headroom above the measured system draw.
- USB-C is a connector shape, not a speed standard.
- Hot-swappable: USB, Ethernet, SATA. Never hot-swap: RAM, CPU, PCIe cards.
- Motherboard standoffs prevent the board shorting against the case.
Firmware, POST and the Boot Sequence
- POST runs before any operating system exists, and reports failures by beeps or LEDs because the display may not work yet.
- Firmware hands control to the bootloader, which loads the kernel into RAM; firmware's job then ends.
- UEFI replaced legacy BIOS: GPT partitioning, drives over 2 TiB, 128 partitions, and Secure Boot.
- Legacy BIOS + MBR is limited to 2 TiB drives and four primary partitions.
- A dead CMOS battery causes forgotten settings and a wrong clock, not a dead machine.
- Changing SATA mode after installing Windows causes a boot failure, because the storage driver no longer matches.
Operating Systems, File Systems and Maintenance
- The OS manages processes, memory, files, devices and security.
- On a single core, multitasking is rapid switching, not simultaneous execution.
- FAT32 caps a single file at about 4 GB; exFAT and NTFS do not.
- Deleting a file removes its directory entry and frees its blocks — the data stays until overwritten.
- Never defragment an SSD: it gains nothing and burns write cycles.
- 3-2-1 backups: three copies, two media types, one off-site — and test a restore.
Unit 3: Networking
Network Types, Topologies and Media
- LAN: one site, you own it. WAN: spans sites over infrastructure you do not own.
- Client-server centralizes accounts, permissions and backups; peer-to-peer has no central administration.
- Star is the standard wired topology; a single cable break affects only one device.
- Copper Ethernet is limited to 100 m including patch cables.
- Twisting in UTP cancels interference — do not untwist more than about 13 mm at a connector.
- Switch ports each get full bandwidth; wireless clients on one access point share it.
The OSI and TCP/IP Models
- OSI layers 1–7: Physical, Data link, Network, Transport, Session, Presentation, Application.
- Encapsulation unit names: data → segment → packet → frame → bits.
- IP addresses stay the same end to end; MAC addresses are rewritten at every hop.
- Switch = layer 2 (MAC). Router = layer 3 (IP).
- TCP is connection-oriented, acknowledged, ordered and retransmitted; UDP is none of those and therefore faster.
- An IP address identifies a machine; a port number identifies a program on it.
- Ports to know: 22 SSH, 25 SMTP, 53 DNS, 80 HTTP, 443 HTTPS.
IP Addressing and Subnetting
- An IPv4 address is 32 bits, written as four octets of 0–255.
- The subnet mask is always contiguous 1s then 0s; /24 = 255.255.255.0.
- Usable hosts = .
- Network address: all host bits 0. Broadcast address: all host bits 1. Neither is assignable.
- Private ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.
- 169.254.x.x (APIPA) means DHCP failed.
- DHCP sequence: Discover, Offer, Request, Acknowledge (DORA).
- IPv6 is 128 bits, written in hex groups, with :: replacing one run of zeros.
Network Devices, Cabling and Security
- Hub = layer 1, switch = layer 2 (MAC), router = layer 3 (IP).
- A switch learns MAC addresses from the source address of incoming frames, and floods when it does not know a destination.
- T568A and T568B differ only by swapping the orange and green pairs.
- Straight-through: same standard both ends. Crossover: A on one end, B on the other.
- Use WPA3, or WPA2 with AES. Never WEP.
- Hidden SSIDs and MAC filtering provide no meaningful security.
- Troubleshoot from layer 1 upward: cable, link light, IP address, gateway, internet, DNS.
Unit 4: Electronics and Digital Logic
Voltage, Current, Resistance and Power
- , and its rearrangements and .
- .
- Convert to base units (V, A, Ω) before substituting: 20 mA = 0.020 A, 4.7 kΩ = 4700 Ω.
- Voltmeter in parallel; ammeter in series; ohmmeter with the power off.
- Mains in Canada is 120 V AC at 60 Hz. Everything in this course is DC.
- About 30 mA through the chest can be fatal — current does the harm, voltage drives it.
Components and Schematic Diagrams
- Resistor colour code: digit, digit, multiplier, tolerance. Black=0 through White=9.
- Gold tolerance band = ±5%; silver = ±10%.
- Silicon diode forward drop ≈ 0.7 V; LED forward voltage is 1.8–3.4 V depending on colour.
- An LED cannot limit its own current and always needs a series resistor.
- Electrolytic capacitors are polarized; ceramic capacitors are not.
- A transistor lets a small current control a large one — the basis of every digital switch.
- On a schematic, a dot at a crossing means connected; no dot means the wires cross without joining.
Series, Parallel and Voltage Dividers
- Series: current is shared, voltages add, resistances add. Total > largest resistor.
- Parallel: voltage is shared, currents add, reciprocals add. Total < smallest branch.
- Two in parallel: .
- n equal resistors in parallel give .
- Voltage divider: .
- Kirchhoff: voltages around a loop sum to zero; currents into a junction equal currents out.
Logic Gates and Truth Tables
- In 5 V logic, above ~2.0 V is logic 1 and below ~0.8 V is logic 0.
- AND needs every input true; OR needs at least one; XOR needs the inputs to differ.
- A bubble on a gate's output means invert: NAND is AND then NOT.
- n inputs give truth-table rows.
- Half adder: SUM = A ⊕ B, CARRY = A · B.
- NAND and NOR are universal — any logic function can be built from either alone.
- Never leave a logic input floating; tie unused inputs high or low.
Boolean Algebra and Simplification
- and — there is no 2 in Boolean algebra.
- , , , .
- Absorption: .
- De Morgan: and .
- Inverting an expression inverts each variable AND swaps the operator.
- AND binds more tightly than OR, exactly as × binds more tightly than +.
- Always verify a simplification with a truth table.
Unit 5: Computer Programming
Variables, Data Types and Input/Output
=assigns a value;==tests equality.input()always returns a string — wrap it inint()orfloat()for numbers./gives a float;//gives integer division;%gives the remainder."5" + "5"is"55", but5 + 5is10.- Flowchart shapes: oval = start/end, parallelogram = input/output, rectangle = process, diamond = decision.
n % 2 == 0is the standard test for an even number.
Selection: if, elif and else
iftests a condition;elifis checked only when everything above was False;elsecatches everything remaining.- In Python, indentation defines the block — it is syntax, not formatting.
andneeds both conditions true;orneeds at least one.- "Outside a range" uses
or; "inside a range" usesand. - An if-elif chain runs at most one branch; separate ifs can all run.
- Order an if-elif chain from the most specific condition to the least.
- Test at the boundary, one below and one above.
Loops: while and for
- Use
forwhen the number of repetitions is known;whilewhen waiting for a condition. range(n)gives 0 to n−1 — n values.range(a, b)stops before b.- Every while loop needs initialize, test, and update.
- Initialize counters and accumulators BEFORE the loop, never inside it.
- A nested loop runs the inner loop fully for every pass of the outer loop.
breakleaves the loop;continueskips to the next pass.
Lists and Strings
- List indexes start at 0; the last valid index is
len(list) - 1. len()gives the number of items;range(len(x))gives exactly the valid indexes.append()adds to the end;marks[i] = vreplaces an existing item.for item in list:gives values;for i in range(len(list)):gives indexes.- Strings are immutable — methods return a new string rather than changing the original.
- Slices stop before the end index:
s[1:4]gives characters 1, 2 and 3. - Always
.strip()text input before comparing it.
Functions, Errors and Debugging
- A parameter is the name in the definition; an argument is the value passed in the call.
returnsends a value back to the caller;printonly displays it.- A function with no
returnreturnsNone. - Local variables exist only inside their function and cannot clash with names outside.
- Syntax errors stop the program before it starts; runtime errors stop it mid-run; logic errors do not stop it at all.
- Read the LAST two lines of a traceback first.
- Test with normal, boundary and invalid inputs.
Unit 6: Computer Interfacing
Microcontrollers and the Arduino
- A microcontroller has CPU, memory and I/O on one chip and runs with no operating system.
setup()runs once at power-up;loop()runs forever.- Pin configuration goes in
setup(); behaviour goes inloop(). - An Uno pin can supply at most 40 mA, and all pins together at most 200 mA.
- PWM is available only on pins 3, 5, 6, 9, 10 and 11.
- Analog inputs A0–A5 report 0–1023 for 0–5 V.
Serial.begin(9600)plusSerial.println()is how you debug a sketch.
Digital Input and Output
- An unconnected input floats and reads random values — every button needs a pull-up or pull-down resistor.
- Pull-down: resistor to ground, button to 5 V, resting LOW. Pull-up: resistor to 5 V, button to ground, resting HIGH.
INPUT_PULLUPuses the chip's internal resistor, so pressed reads LOW.- 10 kΩ is the standard pull resistor value: defines the level firmly, wastes only 0.5 mA.
- Switch bounce produces multiple transitions from one press — debounce in software or hardware.
delay()blocks everything;millis()lets you time without blocking.
Analog Inputs and Sensors
- The Uno's ADC is 10-bit: levels, reported as 0–1023 across 0–5 V.
- , and one step is about 4.9 mV.
- Use
5.0and1023.0in C, or integer division silently returns 0. - A resistive sensor needs a voltage divider, because an analog pin measures voltage, not resistance.
- Choose the fixed resistor near the middle of the sensor's resistance range for maximum sensitivity.
- A TMP36 gives 10 mV per °C with a 500 mV offset.
- Never apply more than 5 V to an analog input.
PWM, Motors and Control Systems
- PWM switches a digital pin rapidly; duty cycle sets the average voltage.
analogWrite(pin, value)takes 0–255. .- PWM is available only on pins 3, 5, 6, 9, 10 and 11 on an Uno.
- A motor needs a transistor (for current) and a flyback diode (for the inductive spike).
- An H-bridge reverses a motor; closing both switches on one side causes destructive shoot-through.
- A servo reads pulse WIDTH: 1.0 ms = 0°, 1.5 ms = 90°, 2.0 ms = 180°, repeated every 20 ms.
- Separate supplies must share a common ground.
- Closed loop measures the result and corrects; open loop does not.
Unit 7: Technology, Environment, Society and Careers
Environmental Impact and E-Waste
- Manufacturing a laptop usually consumes more energy than it will use in its working life.
- Embodied energy is everything spent before the product reaches the user.
- E-waste contains lead, mercury, cadmium and brominated flame retardants — all hazardous.
- It also contains gold, silver, copper and palladium in higher concentrations than natural ore.
- RoHS restricts hazardous substances; WEEE makes producers fund recycling; Energy Star certifies efficiency.
- The hierarchy is reduce, reuse, repair, recycle, dispose — in that order.
- Wipe or destroy a drive before disposal; deletion does not remove the data.
Societal Impact, Ethics and Security
- The digital divide covers access, affordability, connection quality, literacy and accessibility.
- PIPEDA governs private-sector handling of personal information in Canada.
- Copyright is automatic on creation; patents must be applied for.
- Open-source software is licensed, not unowned — MIT is permissive, GPL is copyleft.
- The CIA triad: Confidentiality, Integrity, Availability.
- Most successful attacks exploit vulnerabilities that already had patches.
- Unauthorized access to a computer system is a criminal offence in Canada, regardless of intent.
Workplace Safety, Standards and Careers
- Unplug and hold the power button for five seconds before opening a case.
- Never open a power supply or CRT monitor — their capacitors hold lethal charge.
- ESD damages chips at around 30 V; you cannot feel a charge below about 3000 V.
- WHMIS 2015 has three parts: labels, Safety Data Sheets and worker training.
- A soldering iron runs at about 350 °C and looks the same hot or cold — always use the stand.
- Ontario OHSA gives every worker the right to know, to participate, and to refuse unsafe work.
- Technician = 2-year diploma; technologist = 3-year diploma; P.Eng. = accredited degree plus licence.