TK Study

Software Engineering › Flashcards › Code reading questions

Flashcards for Code reading questions

62 cards where the term can be tested as a code reading question. Study these as flip cards Random

Pseudocode Term Programming Fundamentals (Year 11)

Structured, language-independent English-like code: keywords in capitals (IF, ELSE, WHILE, ENDWHILE, FOR, NEXT, SET, GET, DISPLAY), paired structures and consistent indentation.

Example: Always write a mainline plus subroutines, use indentation and close every structure (ENDIF, ENDWHILE).

Where you would use it in the test
  • Pseudocode: Write an algorithm in the exam pseudocode editor
  • Code reading: Read pseudocode and give the output
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Related past questions: 2025 HSC Q17 (3 marks): Algorithm design; Sample exam Q14 (3 marks): Algorithm design (subroutines); Familiarisation Q8 (3 marks): Algorithm design (linear search)

Memorise: Software development steps and algorithm design

Desk checking Term Programming Fundamentals (Year 11)

Manually stepping through an algorithm with sample data and recording variable values (a trace table) to check it works before coding.

Example: A trace table has a column for each variable and a row for each step.

Where you would use it in the test

Related past questions: 2022 Software Design and Development HSC Q28 (6 marks): Desk check and debugging an algorithm; 2023 Software Design and Development HSC Q28 (6 marks): Desk check and debugging (validation)

Memorise: Software development steps and algorithm design

Inputs, outputs and purpose of an algorithm Term Programming Fundamentals (Year 11)

When analysing an algorithm, identify the data it takes in (inputs), the results it produces (outputs), what it is designed to do (purpose) and how it connects to other subroutines.

Example: 'Inputs: array of marks. Output: the average. Purpose: calculate the class mean.'

Where you would use it in the test
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Short answer: State what the algorithm does

Related past questions: 2025 HSC Q17 (3 marks): Algorithm design

Memorise: Software development steps and algorithm design

Check this one: Not found word-for-word in the supplied syllabus, specifications, marking guidelines or notes; the definition is standard computing knowledge, so check it against your class notes.

Recursion Term Programming Fundamentals (Year 11)

A subroutine that calls itself on a smaller version of the problem until it reaches a base case that stops it.

Example: 'Factorial: n * factorial(n-1) with base case n = 0.'

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Python: Python question: write or complete it in the online Python tool.

Memorise: Software development steps and algorithm design

Check this one: Not named in the 2022 syllabus text; included because of the functional paradigm and past SDD coding questions.

Array Term Programming Fundamentals (Year 11)

A data structure holding a fixed number of items of the same type, accessed by index; can be single or multi-dimensional (rows and columns).

Example: 'marks[0]' is the first item.

Where you would use it in the test
  • Pseudocode: Iterate and sum an array
  • Python: 2D list
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q17 (3 marks): Algorithm design; Sample exam Q21a (1 mark): 2D arrays (Python); Sample exam Q21b (5 marks): Python: subroutines, lists, loops

Memorise: Data structures

Multi-dimensional array Term Programming Fundamentals (Year 11)

An array of arrays, used for grids or tables and accessed by row and column index, such as grid[row][col].

Example: 'grid[2][3]' is row 2, column 3.

Where you would use it in the test
  • Python: 2D list
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Related past questions: Sample exam Q21a (1 mark): 2D arrays (Python); Sample exam Q21b (5 marks): Python: subroutines, lists, loops; 2025 HSC Q26 (5 marks): Design, construct and implement a solution (Python)

Memorise: Data structures

List Term Programming Fundamentals (Year 11)

An ordered, changeable collection of items (Python list) that can grow and shrink and can hold mixed types.

Example: 'scores = [3, 5]; scores.append(8)'

Where you would use it in the test
  • Python: append, index, loop
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Related past questions: 2025 HSC Q26 (5 marks): Design, construct and implement a solution (Python); Sample exam Q21b (5 marks): Python: subroutines, lists, loops

Memorise: Data structures

Stack Term Programming Fundamentals (Year 11)

A last-in, first-out (LIFO) structure where items are added (push) and removed (pop) at the top.

Example: 'Undo uses a stack.'

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Memorise: Data structures

Logic error Term Programming Fundamentals (Year 11)

The program runs but gives the wrong result because the algorithm is wrong, for example using > instead of >=. 2025 markers said students confused these with syntax errors.

Example: 'Average = total / 2 instead of total / count.'

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.
  • Short answer: Outline how a debugging tool finds logic errors
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q15b (3 marks): Testing and debugging

Memorise: Testing and code quality (Year 11)

Object Term The Object-Oriented Paradigm (Year 11)

A single instance of a class with its own attribute values and the ability to run the class's methods.

Example: 's1 = Student("Ava")' creates an object.

Where you would use it in the test
  • Python: create an object
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q22 (3 marks): Modelling tools

Memorise: Object-oriented concepts

Constructor (__init__) Term The Object-Oriented Paradigm (Year 11)

A special method that runs when an object is created and sets its starting attribute values (in Python it is __init__).

Example: 'def __init__(self, name): self.name = name'

Where you would use it in the test
  • Python: Write a class with __init__
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Memorise: Object-oriented concepts

Check this one: The syllabus says implement OOP code but does not name constructors; Python classes need __init__ so it is a safe code-pattern card.

Polymorphism Term The Object-Oriented Paradigm (Year 11)

Different classes provide their own version of the same method name, so one call behaves differently depending on the object.

Example: 'speak() prints Woof for Dog and Meow for Cat.'

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Python: override a method
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.

Memorise: Object-oriented concepts

Method overriding Term The Object-Oriented Paradigm (Year 11)

A subclass supplies its own version of a method it inherited, replacing the parent's version; the way polymorphism is coded.

Example: 'Cat.speak() overrides Animal.speak().'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Memorise: Object-oriented concepts

Check this one: Not named in the syllabus; it is how polymorphism is shown in Python code.

Message passing Term The Object-Oriented Paradigm (Year 11)

Objects communicate by calling each other's methods (sending a message with parameters and receiving a return value).

Example: 'order.addItem(item) sends the message addItem to the order object.'

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Short answer: Investigate how OOP languages handle message passing
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Memorise: Object-oriented concepts

Control algorithm pattern (line follower) Code pattern Programming Mechatronics (Year 11)

A closed-loop loop: WHILE the robot is running, read the sensor, IF the sensor sees dark THEN turn one way ELSE turn the other, ENDIF, ENDWHILE.

Example: 'WHILE on: read light; IF dark THEN turn left ELSE turn right.'

Where you would use it in the test
  • Pseudocode: Write a control loop
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Memorise: Mechatronics: hardware, sensors, actuators, control

Check this one: Not found word-for-word in the supplied syllabus, specifications, marking guidelines or notes; the definition is standard computing knowledge, so check it against your class notes.

SQL injection Term Secure Software Architecture (Year 12)

An attack where malicious SQL is inserted through input so it runs on the database; stopped by parameterised queries and validation.

Example: "' OR 1=1 --" typed into a login box.

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: Sample exam Q18a (3 marks): Defensive data input handling

Memorise: Describe the benefits of developing secure software

Check this one: The course specification names XSS and defensive input handling; SQL injection is the standard example the school notes use.

Cascading style sheets (CSS) Term Programming for the Web (Year 12)

Style rules that control the appearance of web pages, kept separate from HTML. Benefits: consistent appearance, flexibility across browsers and display devices, and easier maintenance.

Example: 'One CSS file changes the font on every page.'

Where you would use it in the test
  • Short answer: Outline benefits of CSS (sample Q16b)
  • Code reading: Read CSS and pick the result (2025 Q7, sample Q16a)
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Related past questions: 2025 HSC Q7 (1 mark): CSS code fragment; Sample exam Q16a (1 mark): CSS (id v class); Sample exam Q16b (2 marks): CSS benefits

Memorise: Web development system: front end, back end, databases

CSS selectors (id v class) Code pattern Programming for the Web (Year 12)

A class selector (.name) styles many elements; an id selector (#name) styles one unique element.

Example: '.button { color: white } styles every element with class button.'

Where you would use it in the test
  • Code reading: 2025 Q7 and sample Q16a: read a CSS fragment
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Related past questions: 2025 HSC Q7 (1 mark): CSS code fragment; Sample exam Q16a (1 mark): CSS (id v class)

Memorise: Web development system: front end, back end, databases

Shell commands (mkdir, cd, touch, cp, rm, cat, grep) Code pattern Programming for the Web (Year 12)

Command line tools used in scripts: mkdir makes a directory, cd changes directory, touch creates a file, cp copies, rm removes, cat shows file contents, grep searches a text file for a pattern.

Example: 'grep "error" log.txt searches log.txt.'

Where you would use it in the test
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Matching or table: Matching or table question: match it to its description, example or category.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.

Memorise: SQL vs ORM

SQL SELECT Code pattern Programming for the Web (Year 12)

Chooses the fields (columns) to return from a table: SELECT name, mark FROM students; SELECT * returns all columns.

Example: 'SELECT FirstName FROM Customer;'

Where you would use it in the test
  • SQL: Select fields
  • Fill in the blanks: Complete the query (sample Q22a)
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multi-select: Multi-select: you tick every correct option, so know all its features or goals.

Related past questions: 2025 HSC Q21 (4 marks): SQL queries; Sample exam Q17 (3 marks): SQL (join, filter, order); Familiarisation Q12a (2 marks): SQL

Memorise: SQL vs ORM

SQL WHERE Code pattern Programming for the Web (Year 12)

Filters rows using conditions (=, <>, >, <, AND, OR). Text values need quotes. 2025 marker note: use quotes around searched text and combine conditions with AND or OR.

Example: "WHERE Suburb = 'Parramatta' AND Age > 18"

Where you would use it in the test
  • SQL: SQL question: write or read it in the SQL query tool.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multi-select: Multi-select: you tick every correct option, so know all its features or goals.

Related past questions: 2025 HSC Q21 (4 marks): SQL queries; Sample exam Q17 (3 marks): SQL (join, filter, order); Familiarisation Q12b (3 marks): SQL (joins, AS)

Memorise: SQL vs ORM

SQL ORDER BY Code pattern Programming for the Web (Year 12)

Sorts results by a field, ascending (ASC, the default) or descending (DESC).

Example: 'ORDER BY mark DESC'

Where you would use it in the test
  • SQL: SQL question: write or read it in the SQL query tool.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q21 (4 marks): SQL queries; Sample exam Q17 (3 marks): SQL (join, filter, order)

Memorise: SQL vs ORM

SQL GROUP BY Code pattern Programming for the Web (Year 12)

Groups rows that share a value so aggregate functions (COUNT, SUM, AVG, MIN, MAX) can be applied to each group.

Example: 'SELECT class, COUNT(*) FROM students GROUP BY class;'

Where you would use it in the test
  • SQL: 2025 Q21 and sample Q22a
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multi-select: Multi-select: you tick every correct option, so know all its features or goals.

Related past questions: 2025 HSC Q21 (4 marks): SQL queries; Sample exam Q22a (2 marks): SQL (GROUP BY)

Memorise: SQL vs ORM

SQL aggregate functions (COUNT, SUM, AVG) Code pattern Programming for the Web (Year 12)

Functions that calculate one value from many rows: COUNT (number), SUM (total), AVG (mean), MIN and MAX.

Example: 'SELECT AVG(mark) FROM results;'

Where you would use it in the test
  • SQL: SQL question: write or read it in the SQL query tool.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q21 (4 marks): SQL queries; Sample exam Q22a (2 marks): SQL (GROUP BY)

Memorise: SQL vs ORM

SQL alias (AS) Code pattern Programming for the Web (Year 12)

Gives a table or column a temporary name to make queries shorter and clearer: SELECT s.name AS student FROM Student AS s.

Example: 'FROM Student AS s JOIN Class AS c'

Where you would use it in the test
  • SQL: SQL question: write or read it in the SQL query tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: Familiarisation Q12b (3 marks): SQL (joins, AS)

Memorise: SQL vs ORM

Check this one: Not found word-for-word in the supplied syllabus, specifications, marking guidelines or notes; the definition is standard computing knowledge, so check it against your class notes.

OOP for ML programming Code pattern Software Automation (Year 12)

ML models are written as classes: attributes hold data and weights, methods train, predict and evaluate.

Example: 'model = LinearRegression(); model.fit(x, y); model.predict([[5]])'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.

Memorise: Decision trees

Neural network code (predict) Code pattern Software Automation (Year 12)

Create the model object, train (fit) on training data, then call predict on new data to make predictions.

Example: 'net.fit(X, y); net.predict(new)'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Memorise: Decision trees

Flowchart Diagram Diagrams and Modelling Tools (Years 11 and 12)

Represents an algorithm with standard symbols connected by lines with arrowheads, read top to bottom and left to right, using only the standard control structures. Label arrows leaving a decision (Yes or No).

Example: 'Diamond: age >= 18? Yes: Display Adult.'

Where you would use it in the test
  • Drawing: Draw a flowchart
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.

Related past questions: 2021 Software Design and Development HSC Q22 (3 marks): Testing (live test data)

Memorise: Drawing rules: DFD, structure chart, storyboard, decision tree, class diagram, ERD

Pseudocode keywords Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

Keywords are in capitals; structural elements come in pairs (BEGIN/END, IF/ENDIF, WHILE/ENDWHILE); indent to show control structures.

Example: 'IF mark >= 50 THEN ... ENDIF'

Where you would use it in the test
  • Pseudocode: Write pseudocode (2025 Q17)
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Fill in the blanks: Fill in the blanks or dropdown: choose this term to complete a statement or table.

Related past questions: 2025 HSC Q17 (3 marks): Algorithm design; Sample exam Q7 (1 mark): Python to pseudocode; Sample exam Q14 (3 marks): Algorithm design (subroutines); Familiarisation Q8 (3 marks): Algorithm design (linear search)

Memorise: Python and SQL you must be able to write

Sequence Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

Steps executed one after another in the order written.

Example: 'GET a; GET b; total = a + b'

Where you would use it in the test
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Drawing: Drawing question: draw or label it in the online drawing tool.

Related past questions: 2025 HSC Q17 (3 marks): Algorithm design

Memorise: Python and SQL you must be able to write

Binary selection (IF THEN ELSE) Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

IF condition THEN process ELSE other process ENDIF: one of two paths is taken.

Example: 'IF age >= 18 THEN DISPLAY "Adult" ELSE DISPLAY "Minor" ENDIF'

Where you would use it in the test
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Drawing: Drawing question: draw or label it in the online drawing tool.

Related past questions: 2025 HSC Q17 (3 marks): Algorithm design

Memorise: Python and SQL you must be able to write

Multi-way selection (CASEWHERE) Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

CASEWHERE expression evaluates to choice a: ... OTHERWISE: default END CASE; only one process runs.

Example: 'CASEWHERE grade evaluates to "A": ... OTHERWISE: ...'

Where you would use it in the test
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Drawing: Drawing question: draw or label it in the online drawing tool.

Memorise: Python and SQL you must be able to write

Nested IF Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

An IF inside the ELSE of another IF to test several conditions where only one process runs.

Example: 'IF a THEN ... ELSE IF b THEN ... ELSE ... ENDIF ENDIF'

Where you would use it in the test
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Python: Python question: write or complete it in the online Python tool.

Related past questions: 2025 HSC Q17 (3 marks): Algorithm design

Memorise: Python and SQL you must be able to write

WHILE loop (pre-test) Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

WHILE condition is true ... ENDWHILE: the condition is tested before each loop, so the body may never run.

Example: 'WHILE count < 5 ... ENDWHILE'

Where you would use it in the test
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Python: Python while

Related past questions: 2025 HSC Q17 (3 marks): Algorithm design; Sample exam Q9 (2 marks): Algorithm design (guessing game)

Memorise: Python and SQL you must be able to write

REPEAT UNTIL loop (post-test) Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

REPEAT ... UNTIL condition is true: the body runs at least once, then the condition is tested.

Example: 'REPEAT GET guess UNTIL guess = answer'

Where you would use it in the test
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: Sample exam Q9 (2 marks): Algorithm design (guessing game)

Memorise: Python and SQL you must be able to write

FOR / NEXT loop (counted) Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

FOR variable = start TO finish STEP increment ... NEXT variable; used when the number of repeats is known.

Example: 'FOR i = 1 TO 5 ... NEXT i'

Where you would use it in the test
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Python: Python question: write or complete it in the online Python tool.

Related past questions: 2025 HSC Q17 (3 marks): Algorithm design

Memorise: Python and SQL you must be able to write

Check this one: Not found word-for-word in the supplied syllabus, specifications, marking guidelines or notes; the definition is standard computing knowledge, so check it against your class notes.

Subroutine and function (pseudocode) Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

BEGIN name (parameters) ... END name. A function returns a single value with RETURN.

Example: 'BEGIN Add (x, y) total = x + y RETURN total END Add'

Where you would use it in the test
  • Pseudocode: Pseudocode question: use it correctly in the exam pseudocode editor.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Python: Python question: write or complete it in the online Python tool.

Related past questions: Sample exam Q14 (3 marks): Algorithm design (subroutines)

Memorise: Python and SQL you must be able to write

Python input and output Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

input() reads text from the user as a string; print() displays output; convert with int() or float().

Example: 'age = int(input("Age: "))'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q19 (3 marks): Developing secure code (Python); Sample exam Q18b (3 marks): Developing secure code (Python input validation)

Memorise: Python basics: input, selection, loops, strings

Python selection (if elif else) Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

if condition: ... elif condition: ... else: ...; indentation matters (Q19 marker note: indentation).

Example: 'if mark >= 50: print("Pass") else: print("Fail")'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q19 (3 marks): Developing secure code (Python)

Memorise: Python basics: input, selection, loops, strings

Python for loop and range Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

for i in range(start, stop): repeats; stop is exclusive; also loops over lists and strings.

Example: 'for i in range(1, 6): print(i)'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q26 (5 marks): Design, construct and implement a solution (Python)

Memorise: Python basics: input, selection, loops, strings

Python while loop Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

while condition: ... repeats while True; make sure the condition changes.

Example: 'while guess != answer: guess = int(input())'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: Sample exam Q9 (2 marks): Algorithm design (guessing game)

Memorise: Python basics: input, selection, loops, strings

Python strings and slicing Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

Strings are sequences: len(s), s[0], s[-1], s[1:4], s.upper(), s.lower(), s.split(), s.strip(), and ord()/chr() for character codes.

Example: 'word[0] is the first letter; word[-1] is the last.'

Where you would use it in the test
  • Python: String processing (2025 Q19)
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q19 (3 marks): Developing secure code (Python)

Memorise: Python basics: input, selection, loops, strings

Python lists Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

A list stores ordered items: append(), remove(), len(), sorting with sort(), looping, and 2D lists as a list of lists.

Example: 'grid = [[0]*3 for _ in range(3)]'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q26 (5 marks): Design, construct and implement a solution (Python); Familiarisation Q13 (6 marks): Python: lists, loops, selection; Sample exam Q21b (5 marks): Python: subroutines, lists, loops

Memorise: Python basics: input, selection, loops, strings

Python 2D list (grid) Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

A list of lists addressed as grid[row][column]; loop with nested for loops.

Example: 'grid[1][2] = 5'

Where you would use it in the test
  • Python: Grid (2025 Q26, sample Q21)
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q26 (5 marks): Design, construct and implement a solution (Python); Sample exam Q21a (1 mark): 2D arrays (Python); Sample exam Q21b (5 marks): Python: subroutines, lists, loops

Memorise: Python basics: input, selection, loops, strings

Python random numbers Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

import random then random.randint(a, b) gives a whole number a to b inclusive; use a set or a check to avoid repeats.

Example: 'n = random.randint(1, 50)'

Where you would use it in the test
  • Python: 2025 Q26 random grid
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q26 (5 marks): Design, construct and implement a solution (Python)

Memorise: Python basics: input, selection, loops, strings

Check this one: Library use is allowed under 'modules and libraries'; random.randint is a standard Python function.

Python functions Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

def name(parameters): ... return value. Functions must be defined before they are called (2025 Q19 marker note: call functions after definition).

Example: 'def area(w, h): return w * h'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q19 (3 marks): Developing secure code (Python)

Memorise: Python basics: input, selection, loops, strings

Global and local variables Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

A local variable exists only inside its function; a global variable is declared outside and can be used throughout (use the global keyword to change it inside a function).

Example: 'count = 0 (global); def add(): global count'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Memorise: Python basics: input, selection, loops, strings

Python file handling Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

open(filename, mode) with modes r (read), w (write, overwrites), a (append); use with to close the file automatically; read(), readline(), write().

Example: 'with open("data.txt") as f: lines = f.readlines()'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Memorise: Python basics: input, selection, loops, strings

Python modules and libraries Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

import a module to use its functions: import random, import math, from sklearn.linear_model import LinearRegression.

Example: 'import math'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Memorise: Python basics: input, selection, loops, strings

Python classes and objects Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

class Name: with __init__(self, ...) to set attributes; methods have self; create objects with Name(...); inheritance with class Child(Parent):.

Example: 'class Dog(Animal): def speak(self): return "Woof"'

Where you would use it in the test
  • Python: Write a class
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q22 (3 marks): Modelling tools

Memorise: Python basics: input, selection, loops, strings

Python try / except Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

try: risky code except ValueError: handle the error; keeps the program running with a helpful message.

Example: 'except ValueError: print("Numbers only")'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: Sample exam Q18b (3 marks): Developing secure code (Python input validation)

Memorise: Python basics: input, selection, loops, strings

Python sqlite3 parameterised query Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

Use ? placeholders and pass values separately, never join user text into the SQL string, to stop SQL injection.

Example: 'cur.execute("SELECT * FROM user WHERE name = ?", (name,))'

Where you would use it in the test
  • Python: Python question: write or complete it in the online Python tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.

Memorise: Python basics: input, selection, loops, strings

Check this one: Parameterised queries are standard secure practice (defensive input handling); the syllabus does not name sqlite3.

Python file and ML code reading (scikit-learn) Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

Know how to read: import, create the model, fit (train), predict.

Example: 'model.fit(x, y); model.predict([[4]])'

Where you would use it in the test
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Python: Python question: write or complete it in the online Python tool.

Memorise: Python basics: input, selection, loops, strings

SQL statement structure Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

SELECT fields FROM table WHERE criteria GROUP BY field ORDER BY field ASC or DESC; keyword AS renames a field for display.

Example: 'SELECT Name FROM Games WHERE Cost > 20 ORDER BY Name ASC'

Where you would use it in the test
  • SQL: Write a query (2025 Q21)
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multi-select: Familiarisation Q2

Related past questions: 2025 HSC Q21 (4 marks): SQL queries; Sample exam Q17 (3 marks): SQL (join, filter, order); Familiarisation Q12a (2 marks): SQL; Familiarisation Q12b (3 marks): SQL (joins, AS)

Memorise: SQL: HSC syntax and must-know queries

SQL relational and logical operators Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

Relational operators: CONTAINS, DOES NOT CONTAIN, EQUALS, NOT EQUAL TO, GREATER THAN (OR EQUAL TO), LESS THAN (OR EQUAL TO). Logical operators: AND, OR, NOT. Put text and dates in quotes.

Example: "WHERE Name CONTAINS 'war' AND Cost < 50"

Where you would use it in the test
  • SQL: SQL question: write or read it in the SQL query tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q21 (4 marks): SQL queries

Memorise: SQL: HSC syntax and must-know queries

SQL calculated aggregate with GROUP BY Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

SELECT Developer, SUM(Cost) AS Totalcost FROM Games GROUP BY Developer ORDER BY Developer DESC.

Example: 'SUM (Games.cost) AS Totalcost'

Where you would use it in the test
  • SQL: SQL question: write or read it in the SQL query tool.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Related past questions: 2025 HSC Q21 (4 marks): SQL queries; Sample exam Q22a (2 marks): SQL (GROUP BY)

Memorise: SQL: HSC syntax and must-know queries

CSS rule syntax Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

selector { property: value; } with comments in /* */. h1 targets an element, #welcome targets an id, .red-text targets a class.

Example: '.red-text { color: red; }'

Where you would use it in the test

Related past questions: 2025 HSC Q7 (1 mark): CSS code fragment; Sample exam Q16a (1 mark): CSS (id v class)

Memorise: SQL: HSC syntax and must-know queries

XSS JavaScript fragment reading Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

Be able to read a short JavaScript fragment and spot where untrusted input is inserted into a page without sanitising.

Example: 'element.innerHTML = userInput is unsafe.'

Where you would use it in the test
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.

Related past questions: Familiarisation Q11a (1 mark): Cross-site scripting; Familiarisation Q11b (2 marks): Cross-site scripting

Memorise: SQL: HSC syntax and must-know queries

Shell script pattern Code pattern Code Patterns: Pseudocode, Python, SQL, CSS (Years 11 and 12)

A script is a text file of commands run in order, e.g. mkdir site, cd site, touch index.html, cp, rm, cat, grep.

Example: 'mkdir site && cd site && touch index.html'

Where you would use it in the test
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.
  • Multiple choice: Multiple choice: pick the option that matches the definition or example.

Memorise: SQL: HSC syntax and must-know queries

Interpret Command word Command Words and Question-type Skills

Draw meaning from.

Example: 'Interpret the code fragment.'

Where you would use it in the test
  • Short answer: Short answer (2 to 4 marks): define, outline or explain it and tie it to the scenario.
  • Code reading: Code or algorithm reading: interpret a fragment and state its output or purpose.

Memorise: NESA key verbs: what each one asks for