Feedback

Study guide

Exploring Computer Science

Organized by the 6 areas on the 2026–27 test. Each topic matches an official objective.

Coding Basics

10 of 50 questions

Programming building blocks

  • A variable is a named place in memory that stores a value that can change, such as score = 0.
  • Common data types: integer (whole number, 7), float or decimal (3.5), string (text in quotes, "cat"), and Boolean (true or false).
  • A conditional (if / else if / else) runs code only when a condition is true: if age >= 13 then show "teen" else show "child".
  • A loop repeats code: a for loop runs a set number of times (count-controlled); a while loop runs as long as a condition stays true (condition-controlled).
  • A loop whose condition never becomes false is an infinite loop, such as while x > 0 when x only grows.
  • In most languages a single = assigns a value, while == compares two values (x == 5 asks whether x equals 5).
  • Boolean operators combine conditions: AND is true only if both parts are true, OR if at least one is, and NOT flips true and false.

Check yourself: Which kind of loop fits "keep asking for a password until it's correct," a for loop or a while loop?

Show answer

A while loop, because it repeats as long as a condition (wrong password) stays true, not a set number of times.

Parts of a function call

  • A function is a named, reusable block of code that does one task; a function call tells it to run.
  • A call has the function's name followed by parentheses holding its arguments: in area(3, 4), area is the name and 3 and 4 are the arguments.
  • Parameters are the variable names listed in the function's definition (function area(length, width)); arguments are the actual values passed in the call.
  • Arguments are usually matched to parameters by position: in area(3, 4), length gets 3 and width gets 4.
  • A function can send a value back with return; the call is replaced by that value, so result = area(3, 4) stores 12.
  • A call with no arguments still needs empty parentheses, such as start(); a function with no return statement gives back nothing (often called null, None, or void).

Check yourself: In the call total = add(5, 9), what are the function name, the arguments, and where does the result go?

Show answer

The name is add, the arguments are 5 and 9, and the returned value is stored in the variable total.

Predicting function output

  • To predict output, replace each parameter with the argument passed in, then follow the function's steps in order.
  • Example: function double(n): return n * 2. Then double(5) returns 10.
  • Nested calls run from the inside out: with add(a, b) returning a + b, double(add(2, 3)) is double(5), which is 10.
  • A function with a conditional gives different output for different input: function sign(x): if x < 0 return "negative" else return "not negative"; sign(-4) returns "negative" and sign(0) returns "not negative".
  • A function stops at the first return it reaches; any lines after it in that path don't run.
  • Common operators: * multiplies, / divides, and % (modulus) gives the remainder, so 7 % 3 is 1 and 10 % 2 is 0 (an even number).
  • Joining strings with + concatenates them: greet("Ana") with return "Hi " + name gives "Hi Ana".

Check yourself: Given function f(x): if x % 2 == 0 return x / 2 else return x * 3 + 1, what does f(7) return?

Show answer

22. 7 % 2 is 1 (odd), so it returns 7 * 3 + 1 = 22.

Tracing variables

  • Tracing means following a program line by line and writing down each variable's value after every step, often in a trace table.
  • Assignment works right to left: the right side is worked out first, then stored. So x = 3; x = x + 2 makes x 5.
  • A variable holds only its latest value: a = 4; b = a; a = 10 leaves b at 4, because b got a copy of 4 before a changed.
  • Swapping two variables needs a temporary one: temp = a; a = b; b = temp. Writing a = b; b = a makes both equal to b's old value.
  • In a loop, update the trace on every pass: total = 0; for i from 1 to 4: total = total + i ends with total = 10 (1 + 2 + 3 + 4).
  • A counter goes up by a fixed amount (count = count + 1); an accumulator adds changing values (total = total + price).
  • Check whether a loop's end value is included: "for i from 1 to 4" usually includes 4, but some languages' ranges, such as range(1, 4) in Python, stop before the end value.

Check yourself: Trace: x = 2; y = x * 3; x = y - 1; y = x + y. What are x and y at the end?

Show answer

x = 5 and y = 11. y becomes 6, then x becomes 5, then y becomes 5 + 6 = 11.

Runtime vs. compile-time errors

  • A compile-time error is caught before the program runs, when the compiler translates the code; the program won't start until it's fixed.
  • Syntax errors (a missing parenthesis, a misspelled keyword, a missing semicolon where one is required) are the most common compile-time errors; in typed languages such as Java, putting text into a number variable is one too.
  • A runtime error happens while the program is running and usually crashes it, even though the code compiled.
  • Common runtime errors: dividing by zero, using a list index that doesn't exist (index out of range), opening a file that isn't there, and running out of memory.
  • A logic error is neither: the program runs without crashing but gives the wrong result, such as using + where - was needed.
  • Interpreted languages such as Python still check syntax before running a file, but most other errors show up only at runtime.

Check yourself: A program compiles, but crashes when a user enters 0 and the code divides by that number. What kind of error is this?

Show answer

A runtime error, because it happens while the program runs (division by zero), not when the code is compiled.

Algorithmic Thinking

10 of 50 questions

Search algorithms

  • Linear search checks items one at a time from the start until it finds the target; it works on unsorted lists and may need to check every item (n checks for n items).
  • Binary search works only on a sorted list: check the middle item, then throw away the half that can't hold the target, and repeat.
  • Binary search is much faster on large lists: each check halves what's left, so 1,000 sorted items need at most 10 checks (2 to the 10th power is 1,024).
  • Example: searching 2, 5, 8, 12, 16, 23, 38 for 23 with binary search checks 12 (too small), then 23 (found) in the right half.
  • The two-pointers technique uses two positions in a list, often one at each end of a sorted list moving toward each other, such as finding two numbers that add up to a target in one pass.
  • In the two-pointers pair-sum method, if the pair's sum is too small, move the left pointer right; if it's too big, move the right pointer left.

Check yourself: A list of 500 names is in random order. Can binary search be used to find one name?

Show answer

Not as is. Binary search needs a sorted list, so use linear search or sort the list first.

Sorting algorithms

  • Bubble sort walks through the list comparing neighbors and swapping any pair that's out of order; after each pass the largest remaining item has "bubbled" to the end.
  • One bubble sort pass on 5, 1, 4, 2 gives 1, 4, 2, 5; it stops when a pass makes no swaps.
  • Merge sort splits the list in half again and again until each piece has one item, then merges the pieces back together in order (divide and conquer).
  • Heap sort builds a heap, a tree where each parent is at least as large as its children, then repeatedly removes the largest item and places it at the end.
  • Bubble sort is simple but slow on large lists (about n squared comparisons); merge sort and heap sort take about n times log n steps, far faster for big lists.
  • Selection sort repeatedly finds the smallest remaining item and moves it to the front; insertion sort builds a sorted section one item at a time, like sorting playing cards in your hand.
  • Merge sort needs extra memory to hold the merged pieces; heap sort sorts in place within the original list.

Check yourself: Which sorting algorithm splits a list into single items and then combines them back in order?

Show answer

Merge sort.

Common data structures

  • An array stores items in order under one name, usually of one type and a fixed size; each item has an index, which starts at 0 in most languages, so the first item is item[0].
  • A list is an ordered collection that can grow or shrink as items are added or removed; Python calls its resizable array a list.
  • A set holds only unique items with no set order, so adding a value that's already there changes nothing; it's useful for removing duplicates.
  • A queue is first in, first out (FIFO), like a lunch line: items are added at the back (enqueue) and removed from the front (dequeue).
  • A stack is last in, first out (LIFO), like a stack of plates or an undo button: push adds to the top and pop removes from the top.
  • A dictionary (map) stores key-value pairs, such as "apple": 1.25, so a value is looked up by its key instead of its position.

Check yourself: Print jobs are handled in the order they were sent. Which data structure fits, a stack or a queue?

Show answer

A queue, because it's first in, first out.

Step-by-step solutions

  • An algorithm is a finite, ordered set of clear steps that solves a problem; each step must be unambiguous, and the steps must eventually end.
  • Decomposition breaks a big problem into smaller ones that are easier to solve, such as splitting "make a game" into score, controls, and levels.
  • Algorithms use three basic structures: sequence (steps in order), selection (choosing with if/else), and iteration (repeating with loops).
  • Pseudocode writes steps in plain, code-like English without a real language's rules, such as: set total to 0; for each price, add price to total; display total.
  • In a flowchart, an oval marks start or end, a rectangle a process step, a diamond a yes/no decision, and a parallelogram input or output.
  • Abstraction keeps only the details that matter, and pattern recognition reuses a solution to a similar problem.
  • Test the steps with sample inputs, including edge cases such as an empty list, zero, or the largest allowed value, and fix any step that fails.

Check yourself: Which flowchart shape shows a yes/no question such as "Is the number even?"

Show answer

A diamond, which marks a decision.

Data and Artificial Intelligence Concepts

10 of 50 questions

Modern uses of AI

  • A chatbot holds a conversation in text or voice; modern ones answer questions, help customers, and draft writing.
  • A large language model (LLM) is AI trained on huge amounts of text that generates language by predicting the next word or part of a word (token); LLMs power most modern chatbots.
  • LLMs can hallucinate: state false information confidently, so their answers should be checked against reliable sources.
  • Autonomous (self-driving) vehicles use cameras, radar, lidar, and AI to sense the road and drive; SAE rates driving automation from Level 0 (none) to Level 5 (full, anywhere).
  • Most cars sold today offer only driver-assistance features (up to Level 2), where the driver must keep watching the road; some robotaxis run at Level 4 in limited areas without a driver.
  • Other everyday uses: recommendations on streaming and shopping sites, voice assistants, translation, spam filtering, and fraud detection at banks.

Check yourself: A chatbot gives a made-up statistic as if it were true. What is this called?

Show answer

A hallucination.

Applications of AI concepts

  • Image processing treats a picture as a grid of pixels, each stored as numbers (such as red, green, and blue values), so a computer can analyze it.
  • Computer vision uses image processing and machine learning to recognize what's in images or video: face unlock, reading text from photos (OCR), and spotting objects for self-driving cars.
  • Perception is how an AI system senses its surroundings through inputs such as cameras, microphones, lidar, and touch sensors; speech recognition is perception of sound.
  • Game-playing AI searches through possible moves to pick the best one; IBM's Deep Blue beat chess champion Garry Kasparov in 1997.
  • DeepMind's AlphaGo beat top Go player Lee Sedol in 2016, using neural networks and reinforcement learning (learning by trial and error from rewards).
  • Natural language processing (NLP) lets AI understand and produce human language, used in translation, voice assistants, and chatbots.

Check yourself: A phone unlocks when it recognizes its owner's face. Which AI area is this?

Show answer

Computer vision (face recognition), which uses image processing on the camera's pixels.

Datasets for training AI

  • A training dataset is the collection of examples a model learns patterns from; the model is only as good as its data ("garbage in, garbage out").
  • Labeled data pairs each input with the right answer, such as photos tagged "cat" or "dog"; supervised learning needs labeled data.
  • Data is usually split into a training set (most of it), a validation set for tuning, and a test set held back to measure performance on unseen data.
  • Overfitting is when a model memorizes its training data and does poorly on new data; more varied data helps prevent it.
  • If the training data underrepresents a group or reflects past unfairness, the model learns that bias, such as face recognition that works worse for some people.
  • Fine-tuning refines an already-trained model with a smaller, focused dataset, such as medical notes; chatbots are also refined using people's ratings of their answers (human feedback).

Check yourself: A model scores 98% on its training data but only 60% on new data. What is the problem called?

Show answer

Overfitting: the model memorized the training data instead of learning patterns that work on new data.

Datasets for decisions

  • A dataset is an organized collection of data, usually a table where each row is one record and each column one variable.
  • Data-driven decisions use evidence from data instead of guesses, such as a store stocking more of what sells in each season.
  • Four types of analytics: descriptive (what happened), diagnostic (why it happened), predictive (what will likely happen), and prescriptive (what to do about it).
  • Primary data is collected yourself for your question (a survey you run); secondary data was collected by someone else (government census figures).
  • A sample must represent the whole population; surveying only your friends about a whole school's lunch choices gives biased results.
  • Correlation is not causation: two things rising together (ice cream sales and sunburns) may both be caused by something else (hot weather).
  • Raw data needs cleaning first: removing duplicates, fixing errors, and handling missing values; an A/B test compares two versions (such as two web page designs) to see which performs better.

Check yourself: A company uses past sales data to forecast how many jackets it will sell next winter. Which type of analytics is this?

Show answer

Predictive analytics, because it forecasts what will likely happen.

Relational database structure

  • A relational database stores data in tables; each table holds one kind of thing (entity), such as Students or Classes.
  • Each row is a record (one item, such as one student), and each column is a field (one attribute, such as last name).
  • A primary key is a field whose value is unique for every record and never blank, such as a student ID number.
  • A foreign key is a field in one table that refers to another table's primary key, linking the two, such as StudentID in a Grades table.
  • Relationships: one-to-one (each student has one locker), one-to-many (one teacher teaches many classes), and many-to-many (students and classes), which uses a linking (junction) table.
  • SQL (Structured Query Language) retrieves and changes data, such as SELECT name FROM Students WHERE grade = 7.

Check yourself: Why is a student's last name a poor choice for a primary key?

Show answer

Two students can share a last name, and a primary key must be unique for every record.

Cybersecurity Concepts

5 of 50 questions

Dangers of exposed information

  • Personally identifiable information (PII) is any data that can identify a person, such as full name, address, birth date, Social Security number, or account numbers.
  • Identity theft is using someone's personal information to commit fraud, such as opening accounts or making purchases in their name.
  • Scammers use details people post publicly (school, pets' names, birthdays) to make messages believable and to guess security questions and passwords.
  • Doxing is publishing someone's private information, such as a home address or phone number, online without consent, usually to harass or threaten them.
  • A digital footprint is the trail of data a person leaves online; posts and photos can be copied and stay online even after they're deleted.
  • Photos can reveal locations through backgrounds or geotags (location data stored in the file), which can expose where someone lives or is right now.
  • Unprotected accounts can be taken over (account takeover) and used to scam the owner's friends or steal money.

Check yourself: Someone posts a classmate's home address and phone number online to get people to harass them. What is this called?

Show answer

Doxing.

Common scams and attacks

  • Phishing uses fake emails, texts, or sites that pretend to be a trusted company to steal passwords or money; spear phishing targets one specific person.
  • Smishing is phishing by text message; vishing is phishing by phone call.
  • Scam email warning signs: urgency ("act within 24 hours"), prizes you didn't enter, requests for passwords or gift cards, mismatched sender addresses, and links whose real address (shown by hovering) doesn't match.
  • A virus attaches to files and spreads when they're run; a worm spreads across networks by itself.
  • A Trojan disguises itself as useful software; ransomware locks or encrypts files and demands payment; spyware secretly collects information.
  • Tech support scams use pop-ups or calls claiming a device is infected and ask for remote access or payment.

Check yourself: A student gets a text saying a package is delayed, with a link to "reschedule delivery." What type of scam is this?

Show answer

Smishing, phishing by text message.

Personal security measures

  • A strong password is long (a passphrase of several random words works well), avoids personal information and dictionary words, and is unique to each account.
  • Reusing a password is risky because one data breach lets attackers try it on other sites (credential stuffing).
  • A password manager creates and stores strong, unique passwords, so the user remembers only one master password.
  • Multi-factor authentication (MFA) requires two or more kinds of proof: something you know (password), something you have (phone code or security key), or something you are (fingerprint).
  • Antivirus (anti-malware) software scans for and removes malicious programs; keep its definitions updated so it recognizes new threats.
  • Install software updates promptly, since they patch security holes attackers use.
  • The 3-2-1 backup rule: keep 3 copies of important data, on 2 different types of storage, with 1 copy off-site or in the cloud, so ransomware or a broken device doesn't destroy it.

Check yourself: A site asks for a password and then a code sent to your phone. Which security measure is this?

Show answer

Multi-factor authentication: something you know (the password) plus something you have (the phone).

Network security measures

  • A firewall filters network traffic, allowing or blocking it by rules (such as by address, port, or program); a hardware firewall protects a whole network and a software firewall protects one computer.
  • Antivirus on every device catches malware that gets past the firewall, such as from an infected download or USB drive.
  • Permissions control who can read, change, or delete files and settings; the principle of least privilege gives each user only the access their job needs.
  • Account management means creating accounts for new users, using standard accounts for daily work and administrator accounts only when needed, and removing accounts promptly when someone leaves.
  • On a home or office router, change the default password, use WPA2 or WPA3 Wi-Fi encryption, and keep the router's firmware updated.
  • A guest network keeps visitors' devices separate from the main network and its computers.

Check yourself: A student worker only needs to view the school's schedule files, not change them. What security principle says to give view-only access?

Show answer

Least privilege: give each user only the access they need.

Networks and the Internet

5 of 50 questions

Networks and the internet

  • A network is two or more connected devices that share data and resources such as files, printers, and an internet connection.
  • A LAN (local area network) covers one home, school, or building; a WAN (wide area network) connects places across cities or countries.
  • The internet is a global network of networks, the largest WAN, linking millions of networks that agree to share data using common rules (TCP/IP).
  • An Internet service provider (ISP) connects homes and businesses to the internet.
  • Every device on the internet is reached by an IP address, and DNS (the Domain Name System) turns names like example.com into IP addresses.
  • Data travels in small pieces called packets, which can take different routes and are put back together at the destination.
  • The World Wide Web (websites and links) is one service that runs on the internet; email, streaming, and online games are others.

Check yourself: Is the World Wide Web the same thing as the internet?

Show answer

No. The internet is the global network of networks; the web is one service (websites) that runs on it.

Why protocols matter

  • A protocol is an agreed set of rules for how data is formatted, sent, and received.
  • Protocols let devices from different makers and with different operating systems communicate, since all follow the same rules.
  • Protocols work in layers: the TCP/IP model has four (application, transport, internet, and network access or link), each handling one part of the job.
  • Protocols handle addressing, splitting data into packets, putting them back in order, and error checking so lost or damaged data is resent.
  • Secure protocols encrypt data so others can't read it: HTTPS instead of HTTP for websites, SSH instead of Telnet for remote access, and WPA2 or WPA3 for Wi-Fi.
  • A padlock and https:// in a browser show the connection uses TLS encryption; it protects data in transit but doesn't prove the site itself is honest.

Check yourself: Why should a student look for https:// before typing a password on a website?

Show answer

HTTPS encrypts the data sent between the browser and the site, so others on the network can't read the password.

Common networking protocols

  • TCP/IP is the internet's main protocol suite: IP addresses and routes packets, and TCP makes sure they arrive.
  • TCP (Transmission Control Protocol) is reliable: it sets up a connection, numbers packets, and resends lost ones (web pages, email, file downloads).
  • UDP (User Datagram Protocol) is faster but doesn't confirm delivery, so it suits live video calls, streaming, and online gaming, where speed matters more than a few lost packets.
  • SNMP (Simple Network Management Protocol) monitors and manages network devices such as routers, switches, and printers.
  • HTTP and HTTPS (secure, port 443) load web pages; DNS turns domain names into IP addresses; DHCP automatically gives devices IP addresses.
  • SMTP sends email; POP3 and IMAP receive it; FTP transfers files.

Check yourself: A video call app cares more about speed than about resending every lost packet. Which transport protocol fits, TCP or UDP?

Show answer

UDP, which is faster because it doesn't confirm delivery or resend lost packets.

Home and office connection gear

  • A modem connects to the ISP's line (cable, DSL, or fiber, where it's called an ONT) and converts its signal into data a network can use.
  • A router connects the home network to the internet, shares one connection among devices, and gives each device a private IP address (DHCP).
  • A wireless access point lets devices join the network over Wi-Fi; most home routers have one built in.
  • A switch adds more wired Ethernet ports so more devices can plug in.
  • Many ISPs supply a gateway, one box that combines a modem, router, and Wi-Fi access point.
  • Range extenders and mesh Wi-Fi systems spread Wi-Fi to areas with a weak signal.
  • Cables: Ethernet cables with RJ45 plugs connect devices to the router or switch; coaxial cable carries cable internet to the modem. Each device needs a network adapter (NIC), wired or wireless.

Check yourself: Which device converts the signal from the ISP's cable line into data the home network can use?

Show answer

The modem.

Hardware and Systems Concepts

10 of 50 questions

Computer components

  • The CPU runs instructions; it fits a socket on the motherboard and needs a cooler and thermal paste.
  • The motherboard connects everything: CPU socket, RAM slots, expansion slots, and ports; its chipset sets what it supports.
  • RAM is temporary working memory; it must match the board's type (DDR4 or DDR5).
  • The GPU processes graphics; it can be integrated in the CPU or a separate card.
  • The power supply (PSU) converts AC wall power to DC voltages.
  • The CMOS battery keeps firmware settings and the clock.

Check yourself: A computer's clock and firmware settings keep resetting. Which part has likely failed?

Show answer

The CMOS battery.

Operating system duties

  • An operating system (OS) manages a computer's hardware and software and lets users and programs use it; examples are Windows, macOS, Linux, ChromeOS, Android, and iOS.
  • Process management: the OS starts and stops programs and switches the CPU between them so several seem to run at once (multitasking).
  • Memory management: it gives each program space in RAM and frees it when the program closes; virtual memory uses storage when RAM runs short.
  • File management: it organizes files and folders on storage and tracks where each is saved.
  • Device management: it controls hardware such as printers and keyboards through drivers, small programs that translate between the OS and a device.
  • Security: user accounts, passwords, and permissions control who can use the computer and its files.
  • User interface: a GUI (windows, icons, and menus) or a command-line interface; the kernel is the core of the OS that controls the hardware.

Check yourself: A new printer won't work until a small program is installed that lets the OS control it. What is that program called?

Show answer

A driver.

Binary and decimal

  • Binary (base 2) uses only the digits 0 and 1; each digit is a bit, and 8 bits make a byte.
  • Binary place values, right to left, are 1, 2, 4, 8, 16, 32, 64, 128 (each place doubles).
  • Binary to decimal: add the place values that have a 1. Binary 1011 = 8 + 0 + 2 + 1 = 11; 11111111 = 255.
  • Decimal to binary: subtract the largest place value that fits and repeat, writing 1 for places used and 0 for others. 13 = 8 + 4 + 1, so 13 = 1101.
  • Another way: divide by 2 repeatedly and read the remainders from bottom to top (13 gives remainders 1, 0, 1, 1, read up as 1101).
  • With n bits you can make 2 to the n different values: 4 bits give 16 values (0 to 15), and 8 bits give 256 values (0 to 255).
  • A binary number ending in 0 is even, and one ending in 1 is odd.

Check yourself: Convert binary 10110 to decimal.

Show answer

22 (16 + 0 + 4 + 2 + 0).

Hardware and software together

  • Hardware is the physical parts (CPU, RAM, storage, keyboard); software is the instructions (programs) that tell hardware what to do.
  • Computers follow an input, processing, output, and storage cycle: a key press is input, the CPU processes it, the screen shows output, and files are saved to storage.
  • Programs are written in high-level languages, then a compiler or interpreter translates them into machine code, binary instructions the CPU can run.
  • The CPU repeats the fetch-decode-execute cycle: fetch an instruction from memory, decode what it means, and execute it; its control unit directs the steps and its ALU (arithmetic logic unit) does math and comparisons.
  • A program is loaded from storage into RAM to run, because RAM is much faster; RAM is volatile (cleared when power is off), while storage keeps data.
  • Applications ask the operating system for resources, and the OS uses drivers to control hardware; apps usually don't control hardware directly.
  • Firmware (BIOS or UEFI) is software stored on a chip that starts the hardware and loads the OS when the computer turns on.

Check yourself: What three steps does the CPU repeat to run each instruction?

Show answer

Fetch, decode, and execute.