VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

Ultimate GCE A-Level H2 Computing Syllabus Guide | SEAB 9569 Python, Algorithms, Databases and Practical Study Planning

The Ultimate GCE A-Level H2 Computing Syllabus Guide explains SEAB 9569 for Singapore students taking the revised course first examined in 2027. It connects the assessment requirements with the work students actually need to do: design algorithms, write and test Python programs, organise data, build small web applications, reason about security and evaluate simple machine-learning models. Parents can use it to understand the subject beyond the broad label of coding.

A confident Computing journey begins with clear thinking before fast typing. Students need to translate a problem into precise rules, choose suitable representations, trace what a program does and test whether its output satisfies the task. This guide develops those habits through original worked examples, explanations and practical study decisions. Start with the examination structure and subject-fit chapters, then follow the teaching chapters that match the school’s current sequence.

  • Scope: Singapore-Cambridge H2 Computing, SEAB 9569, revised 2027 school-candidate syllabus; checked on 17 November 2026.
  • Assessment: a written paper and a lab-based paper; both contain compulsory questions.
  • Practical preparation: Python, data structures, SQLite, Flask, web interfaces and simple machine learning belong together.
  • Core habit: state what correct behaviour means before implementing it.
  • Revision priority: trace, code, test, explain and improve, with evidence from the student’s own attempts.
  • Family decision: consider interest, perseverance, school availability, workload and current programme prerequisites rather than assuming that using computers means enjoying Computing.

Chapter index

Chapters 1–6
  1. 1. Read the 2027 assessment correctly
  2. 2. Decide whether Computing fits the student
  3. 3. Turn a request into a precise problem
  4. 4. Make Python control flow visible
  5. 5. Validate data and test behaviour deliberately
  6. 6. Understand recursion as a chain of smaller problems
Chapters 7–12
  1. 7. Choose searching and sorting methods with conditions
  2. 8. Use stacks, queues and linked structures purposefully
  3. 9. Understand trees and hashing through traces
  4. 10. Use objects to organise state and behaviour
  5. 11. Connect representations to the information they encode
  6. 12. Design databases around relationships and dependencies
Chapters 13–18
  1. 13. Explain networks as cooperating systems
  2. 14. Build a small web application with clear boundaries
  3. 15. Connect security and ethics to concrete consequences
  4. 16. Learn machine learning through data and evaluation
  5. 17. Build a study routine that produces independent solutions
  6. 18. Answer the questions students and parents ask most

CHAPTER 1 OF 18

1. Read the 2027 assessment correctly

Back to contents

Begin with the SEAB 2027 school-candidate subject list and the revised H2 Computing 9569 syllabus. The 2027 document identifies this as the first examination year of the revision. Check the year on every syllabus and specimen resource; familiar subject codes do not guarantee that older materials describe the current assessment.

PaperDurationMarksWeightQuestions
1: Written3 hours10060%6–8
2: Lab-based3 hours10040%4
H2 Computing 9569 examination structure for 2027

Both papers are compulsory throughout. Paper 1 covers all six modules; Paper 2 covers modules 1, 2, 3, 4 and 6. The lab environment includes Python 3, Flask, JupyterLab, scikit-learn, DB Browser for SQLite and Notepad++. A reference guide is provided for Paper 2. Approved calculators may be used. Saving the required work is included in the allotted examination time.

Equal raw marks do not mean equal contributions. A practice result of 70 out of 100 in the written paper and the same raw result in the lab paper represent different assessment weights. More importantly, the two results may conceal different strengths. A student can explain an algorithm convincingly but struggle to implement it under time pressure, or produce working code while giving incomplete written explanations.

Use specimen papers to understand the job

The written specimen and lab specimen show how tasks are presented. The lab specimen asks for saved notebooks with code and output, specifies filenames, and awards up to six marks for coding standards. Follow the actual paper’s instructions; a specimen is preparation, not a prediction of its exact questions.

During practice, assess the complete product. Does the code run from a clean start? Is its output visible? Is the file saved where requested? Can another reader identify which part answers which task? These are not cosmetic concerns when the examiner needs an inspectable solution. Good habits reduce avoidable uncertainty at the moment of submission.

This guide’s chapter order is a learning route rather than a national timetable. Schools may teach topics in another sequence. Use the official syllabus to check scope and the school’s programme to plan weekly work. For a later sitting, reopen the correct examination-year documents before relying on any administrative detail here.

Contents · Next chapter

CHAPTER 2 OF 18

2. Decide whether Computing fits the student

Back to contents

Enjoying games, devices or social media can spark an interest in Computing, but the subject asks a different set of questions. How can a task be expressed precisely? What information should be stored? Which procedure gives a correct result for every permitted input? What happens when a user enters unexpected data? A student who enjoys investigating these questions has a useful starting point.

Prior coding experience can help, but its quality matters. A pupil who has copied several impressive applications may have less independent control than a beginner who can explain a small program line by line. Ask what the student can build, adapt and debug without following a video at the same time. That gives a clearer picture than counting programming languages on a list.

Look for habits that can develop

Useful habits include reading instructions closely, breaking a task into parts, tracking changing values and staying curious when the first attempt fails. Mathematical reasoning helps with algorithms, representations and data analysis. Clear written language helps explain design choices and consequences. Computing draws on all of these; it is neither entirely mathematical nor entirely practical.

Try a small diagnostic before making a major judgement. Give the student a list of scores and ask them to describe, in ordinary language, how to find the largest value. Then ask what should happen if the list is empty. Finally, change the task to find the second-largest distinct score. The conversation reveals whether they can refine a solution when an assumption changes.

A student who initially overlooks the empty case is not disqualified. The important question is whether they can understand the issue and improve the design. Likewise, frustration with an error message is common; progress comes from learning to gather evidence rather than repeatedly changing random lines. These are teachable behaviours rather than fixed personality traits.

Check which schools offer the subject and what their entry or subject-combination conditions are. Do not assume every college has the same arrangements. If a university route matters, read the institution’s current prerequisite statement for that programme. A useful school subject does not automatically become a universal admission requirement, and admission requirements should not be inferred from a course title.

Parents can also consider how the subject fits the whole week. Practical work needs uninterrupted time to build, test and understand a solution. A schedule containing many rushed fragments can make debugging feel harder than it is. Plan realistic sessions and a way to ask for help when a recurring problem remains unresolved.

For families exploring support, the existing JC1 H2 Computing guide and JC2 H2 Computing guide provide related reading. This longer teaching companion focuses on understanding and practice rather than assuming that every learner needs the same additional lessons.

Contents · Previous chapter · Next chapter

CHAPTER 3 OF 18

3. Turn a request into a precise problem

Back to contents

A computer cannot infer all the intentions hidden inside an everyday instruction. “Find the best result” might mean the highest score, the fastest time, the most recent record or the largest improvement. Before coding, clarify the input, the required output and the rules connecting them. Ambiguity resolved early prevents a large amount of unnecessary debugging later.

Imagine a reading club that wants to total the minutes its members read. The initial request sounds simple. But should a missing day count as zero? Are negative entries rejected? Should duplicate submissions replace an earlier record or be added? Does the report cover one member or the whole club? Each answer changes the program’s behaviour.

Write a small contract

A useful contract for a first exercise might say: the input is a list of non-negative integer reading times, each representing one day; the output is their sum; an empty list produces zero. This contract is deliberately small. It allows the learner to build and test one reliable function before adding interfaces, files or accounts.

Now decompose a larger version into tasks: obtain records, validate a record, calculate totals, select a reporting period and display the result. Each task can have its own input and output. The point is not to create as many functions as possible. It is to give each part a clear responsibility that can be understood and checked.

For the total, begin with a running value of zero. Read each daily value in turn and add it to the running value. Return the result after the last item. A trace of inputs 12, 8 and 15 produces totals 12, 20 and 35. The same reasoning works for an empty list because the loop never runs and the initial total remains zero.

Use examples to expose assumptions

Three carefully selected examples can clarify a specification better than a paragraph of vague promises. Use an ordinary case, a boundary case and a case that violates a rule. Explain the expected result before implementing anything. If two people disagree about the expected output, they have discovered a design question rather than a programming error.

Pseudocode is useful because it lets the student focus on logic without becoming distracted by punctuation. It should still be precise about repetition, selection and values. “Process the data” is not an algorithmic step unless the processing has been defined elsewhere. Replace it with actions that another person could follow consistently.

When a task grows, extend a working small version. First calculate one total correctly. Then handle several members. Then read records from a file. Then connect a database. At each stage, keep a known example that should still work. This makes it easier to locate the stage where a new error enters.

Contents · Previous chapter · Next chapter

CHAPTER 4 OF 18

4. Make Python control flow visible

Back to contents

Sequence, selection and iteration are the basic ways a program controls its work. Sequence establishes order. Selection chooses a path according to a condition. Iteration repeats a process. Students need to recognise these structures in a task before choosing syntax. The following original example selects scores at or above a threshold and returns them in their original order.

def qualifying_scores(scores, threshold):
    selected = []
    for score in scores:
        if score >= threshold:
            selected.append(score)
    return selected

print(qualifying_scores([42, 60, 59, 80], 60))
print(qualifying_scores([], 60))

The outputs are [60, 80] and []. The function creates a new list, visits each input score, tests one condition and appends qualifying values. It returns only after the loop finishes. Moving the return statement inside the loop would change the behaviour by stopping the function too early.

Trace before running

For the first call, draw columns for the current score, the comparison result and the selected list. The score 42 leaves the list empty; 60 adds the first item; 59 changes nothing; 80 adds the second item. This trace is more useful than guessing the final output because it reveals exactly when the program state changes.

Parameters make the function reusable. The threshold is supplied by the caller rather than hidden in a global variable. A different call can select scores above another boundary without changing the function body. Local variables also keep temporary work inside the function, making it easier to reason about one task at a time.

Be clear about types. The example assumes numerical scores and a numerical threshold. If a score arrives from a text file as the string "60", it may need conversion before numerical comparison. A program that prints a value that looks like a number has not necessarily stored a number. Inspect the representation as well as its appearance.

Use names that explain the role

A name such as selected communicates more than x in this example. Comments should explain a decision or assumption rather than merely repeat the code in English. Indentation is part of Python’s structure, so visual organisation and behaviour are connected. The official Python control-flow tutorial is a useful syntax reference alongside the examination guide.

For practice, adapt the function to return the number of qualifying scores, then the total of those scores. Explain what changes and what remains the same. Finally, decide whether the threshold boundary is inclusive. A correct solution to one version can be wrong for another if the specification changes from “at least” to “greater than”.

Contents · Previous chapter · Next chapter

CHAPTER 5 OF 18

5. Validate data and test behaviour deliberately

Back to contents

Validation checks whether data satisfies stated rules. Verification checks whether data matches the intended source or has been transferred accurately. A valid value is not necessarily the correct value. A date can have an acceptable format and still describe the wrong person’s birthday. Students should explain what a particular check establishes and what it cannot establish.

Consider a booking quantity that must be an integer from 1 to 12. A type conversion can reject text that cannot be interpreted as an integer, while a range check rejects values outside the allowed interval. These are separate checks. An empty field needs attention too, because the absence of data is different from a supplied value of zero.

Original validation function

def parse_quantity(text):
    try:
        value = int(text)
    except ValueError:
        return None
    if 1 <= value <= 12:
        return value
    return None

print([parse_quantity(x) for x in ["1", "12", "0", "13", "four"]])

The output is [1, 12, None, None, None]. The contract here is a string input and either an accepted integer or None. The implementation accepts ordinary integer text, including leading or trailing spaces permitted by Python’s conversion. If a task requires a stricter format, such as exactly two digits, that additional condition must be designed explicitly.

A test table should include input, expected result, actual result and a short reason. The endpoints 1 and 12 check the inclusive boundaries. Values 0 and 13 check just outside them. An ordinary interior value checks normal behaviour, while non-numerical text checks the conversion path. Repeating many interior values while omitting both boundaries leaves a significant gap.

Different errors need different investigations

A syntax error prevents the interpreter from understanding the program. A runtime error occurs during execution, such as accessing an invalid index. A logic error can produce the wrong result while the program runs without complaint. The absence of an exception therefore does not prove correctness. Compare actual output with the independently determined expected result.

When debugging, reduce the problem. Find the smallest input that still demonstrates the failure, trace the changing values and inspect the first point where reality differs from the intended state. Change one relevant thing and rerun both the failing case and a case that previously worked. This creates evidence that the repair fixes the cause without breaking ordinary behaviour.

Do not catch every exception merely to hide an error message. A broad catch can conceal a programming mistake and make the output look successful. Handle expected failures deliberately, and let unexpected ones remain visible during development. A helpful error message identifies what the user should correct without exposing private data or unnecessary internal details.

Contents · Previous chapter · Next chapter

CHAPTER 6 OF 18

6. Understand recursion as a chain of smaller problems

Back to contents

A recursive solution calls the same function on a smaller or otherwise simpler version of the problem. It needs a stopping condition and a way to make progress toward that condition. Without both, a definition can repeat indefinitely. The student’s task is to explain what each call means, not merely to recognise that the function name appears inside its own body.

Worked example: digit sum

def digit_sum(n):
    if n < 0:
        raise ValueError("Use a non-negative integer")
    if n < 10:
        return n
    return n % 10 + digit_sum(n // 10)

print(digit_sum(472))
print(digit_sum(0))

The function assumes an integer input. Its outputs are 13 and 0. For 472, the last digit contributes 2 and the smaller problem is the digit sum of 47. That contributes 7 plus the digit sum of 4. The final call returns 4 directly, and the waiting additions produce 11 and then 13.

The important state includes unfinished work. The first call has not forgotten its addition of 2 while the next call runs. A call-stack sketch makes those waiting operations visible. Students who trace only the sequence 472, 47, 4 can miss how the returned values combine on the way back.

Compare with iteration

An iterative version can repeatedly take the remainder after division by ten, add it to a running total and remove the final digit using integer division. Both approaches can express the same idea. Recursion can fit naturally with recursive structures, while iteration may make certain repeated operations more direct. Avoid the blanket claim that recursion is always faster or always better.

For a non-negative integer with d decimal digits, this particular recursive approach makes work proportional to the number of digits under the usual school-level arithmetic model. That statement concerns this algorithm and its assumptions. It does not mean every recursive function has linear running time. A function that calls itself twice on overlapping subproblems can behave very differently.

Test the stopping condition separately. Zero and a one-digit number should return immediately. A two-digit number should make one recursive step. A negative integer should follow the explicit error path. These cases reveal whether the design reaches its base case and whether the declared domain is enforced.

To practise, explain why replacing n // 10 with n destroys progress. Then write the iterative version and compare outputs over several inputs. The comparison helps the learner see recursion as a way of organising a solution rather than a mysterious new kind of arithmetic.

Contents · Previous chapter · Next chapter

CHAPTER 7 OF 18

7. Choose searching and sorting methods with conditions

Back to contents

An algorithm’s name is not enough to justify using it. Binary search depends on an ordered collection and an appropriate way to access its middle element. Linear search can work without that ordering. A student who applies binary search to an unsorted list may obtain an answer quickly but incorrectly. Correctness conditions come before speed comparisons.

Original binary search

def binary_search(values, target):
    low = 0
    high = len(values) - 1
    while low <= high:
        middle = (low + high) // 2
        if values[middle] == target:
            return middle
        if values[middle] < target:
            low = middle + 1
        else:
            high = middle - 1
    return -1

print(binary_search([4, 9, 15, 22, 31], 22))
print(binary_search([4, 9, 15, 22, 31], 20))

The outputs are 3 and −1. Indices start at zero. The search interval includes both endpoints, and each unsuccessful comparison removes the middle item and one side from consideration. If duplicate values exist, this version returns one matching index, not necessarily the first. A requirement to return the first match needs a modified design.

Trace the unsuccessful search carefully. Failure is a normal outcome, not an exceptional accident. The interval eventually becomes empty, represented by the lower index exceeding the upper index. Keeping that condition visible helps prevent endless loops and skipped endpoints.

Read Big-O as a growth description

AlgorithmWorst-case growthImportant condition or qualification
Linear searchO(n)May inspect every item
Binary searchO(log n)Sorted data with efficient indexed access
Bubble sortO(n²)Repeated adjacent comparisons
Insertion sortO(n²)May shift many earlier items
Merge sortO(n log n)Standard divide-and-merge method
QuicksortO(n²)Unbalanced partitions can produce the worst case
Typical worst-case time growth for standard implementations

Big-O does not give an exact stopwatch reading. It describes how an upper bound grows with input size under a model of operations. Hardware, implementation details and small-input overhead still affect measured time. Also distinguish worst-case claims from average behaviour; quicksort is often efficient in practice without having the same worst-case bound as merge sort.

For insertion sort, imagine a sorted prefix growing one item at a time. Inserting 5 into the sorted prefix 2, 7, 9 requires moving 9 and 7 to make room. Explain the invariant: after each pass, the processed prefix is sorted. That invariant is a reason to trust the algorithm, not merely a description of one example.

Practice should include traces, implementations and comparisons. If the question asks for a named algorithm, using a built-in sorting function may bypass the required work. Read the instruction before deciding whether a library operation is appropriate. The fastest line to type is not always the solution the task asks the student to demonstrate.

Contents · Previous chapter · Next chapter

CHAPTER 8 OF 18

8. Use stacks, queues and linked structures purposefully

Back to contents

A data structure organises information so that certain operations have a clear meaning. A stack removes the most recently added item first. A queue removes the earliest waiting item first. These rules are useful because they model different needs: undoing a recent action differs from serving requests in arrival order.

For a stack exercise, push the values 6, 2 and 9, then pop twice. The returned values are 9 and 2, leaving 6. For a queue receiving the same values, two removals return 6 and 2, leaving 9. The stored values are identical initially, but the permitted access rule changes the result.

A circular queue needs an explicit convention

Suppose a fixed array has capacity four. Let the head identify the next removal position, the tail identify the next insertion position, and a count record the number of stored items. After an insertion, advance the tail using modulo four; after a removal, advance the head in the same way. The count distinguishes full and empty states that could otherwise have identical pointer positions.

Starting empty, insert A, B and C. Remove A and B. Then insert D, E and F. The physical array may contain E, F, C and D, while the logical queue order is C, D, E, F. This example shows why reading the array left to right is not always the same as reading the queue from front to back.

Other implementations can use different pointer meanings. A tail might identify the last occupied position rather than the next empty position. Neither convention is automatically wrong, but every operation must follow the selected convention. In an examination task, adopt the definitions supplied instead of importing a different template without adjustment.

Links describe relationships rather than physical adjacency

In a linear linked list, a node contains data and a reference to the next node. Insertion changes connections. If a new node is inserted between two existing nodes, preserve the old next reference before reconnecting the chain. Losing the reference can make the remaining nodes unreachable even though their data has not physically vanished.

Draw a before-and-after picture for each update. Identify the head, the inserted or removed node and the next reference. Special cases include an empty list, an insertion at the beginning and deletion of the final node. A general-looking procedure that ignores these cases can fail on the smallest valid inputs.

Choose a representation based on required operations. A Python list is convenient for many examples, but it is not automatically equivalent in cost or behaviour to every abstract data structure. Explain which operations the task expects and how the implementation realises them. That separation helps students reason beyond memorised code.

Contents · Previous chapter · Next chapter

CHAPTER 9 OF 18

9. Understand trees and hashing through traces

Back to contents

A tree represents hierarchical relationships. In a binary tree, each node has at most two children. A binary search tree adds an ordering rule, such as smaller keys on the left and larger keys on the right for distinct-key examples. Not every binary tree is a binary search tree, and a search-tree property must be maintained by the operations that build it.

Worked example: build and traverse a search tree

Insert the distinct keys 8, 3, 11, 1, 6, 9 and 14 in that order. The root is 8. Keys 3 and 11 become its left and right children. Keys 1 and 6 sit below 3; keys 9 and 14 sit below 11. Searching for 6 compares with 8, then 3, then 6. The path follows the ordering rule rather than visiting every node.

An in-order traversal visits the left subtree, the node, then the right subtree, producing 1, 3, 6, 8, 9, 11, 14. Pre-order produces 8, 3, 1, 6, 11, 9, 14. Post-order produces 1, 6, 3, 9, 14, 11, 8. Draw the traversal route and explain each visit rather than memorising the output list.

The shape matters. Inserting already ordered distinct keys into a simple unbalanced search tree can create a long chain. Search then has linear worst-case behaviour. Do not claim that every binary search tree guarantees logarithmic search time. That stronger guarantee requires additional conditions or balancing methods.

A hash value selects a location, not a unique identity

For an original toy table of size seven, use the hash function key modulo seven. Keys 10, 17 and 24 all map to index three. This is a collision, not proof that the keys are identical. A design must specify how to store and find all the records whose keys share that location.

Separate chaining can keep a collection of records at each location. Linear probing instead looks for another available position according to a defined sequence. With probing, retrieval must follow the compatible sequence, and deletion needs care so that it does not break a later search. These are consequences of the design rather than arbitrary special rules.

Distinguish a hash-table function from a cryptographic hash. Both map inputs to outputs, but their goals differ. A simple modulo function is useful for illustrating storage locations; it is not suitable for protecting passwords. Using the same word in two topics does not make the techniques interchangeable.

For revision, take one set of keys and compare a list, a search tree and a hash table. Ask how insertion works, how a missing key is detected and what can cause poor performance. The comparison trains the student to choose a structure based on operations and conditions rather than familiarity alone.

Contents · Previous chapter · Next chapter

CHAPTER 10 OF 18

10. Use objects to organise state and behaviour

Back to contents

Object-oriented programming groups related state with the operations that act on it. A class describes a kind of object; an instance is a particular object created from that description. This can make a program easier to understand when several records share the same kinds of behaviour but hold different values.

Original class example

class ReadingLog:
    def __init__(self, member):
        self.member = member
        self._minutes = []

    def add_minutes(self, minutes):
        if minutes < 0:
            raise ValueError("Minutes cannot be negative")
        self._minutes.append(minutes)

    def total(self):
        return sum(self._minutes)

log = ReadingLog("Mira")
log.add_minutes(18)
log.add_minutes(27)
print(log.member, log.total())

The output is Mira 45. The example assumes numerical minute values. Each object gets its own list during initialisation, so two members do not accidentally share the same readings. The method validates a rule before changing the state. The leading underscore communicates an internal-use convention in Python; it is not a security barrier that prevents all outside access.

Encapsulation is useful when callers can ask an object to perform an operation without manipulating every internal detail directly. If the storage representation later changes, the public methods can preserve the intended behaviour. However, merely adding a class does not automatically create a good design. The responsibilities still need to be coherent.

Inheritance needs a meaningful relationship

A subclass can reuse and specialise behaviour from a parent class. Before introducing inheritance, ask whether the new class really represents a specialised kind of the parent. Sharing a few attributes is not always enough. Sometimes one object should contain another object rather than inherit from it.

Polymorphism allows code to use a common operation while different objects implement that operation appropriately. For example, several report objects might each provide a method that formats their own summary. The caller can request the summary without a long sequence of tests for every concrete class. Explain the shared interface and the differing behaviour.

A class diagram should help a reader see attributes, methods and relationships. It is not simply a decorated list of class names. Use the notation taught by the school consistently, and ensure the diagram agrees with the code. An attribute marked as belonging to every instance should not accidentally become shared mutable class state.

For practice, create two reading logs, add different values and verify that their totals remain independent. Then attempt an invalid negative addition and confirm that the existing total is unchanged. These tests examine the object’s behaviour rather than only whether its constructor runs successfully.

Contents · Previous chapter · Next chapter

CHAPTER 11 OF 18

11. Connect representations to the information they encode

Back to contents

Computers store representations. A sequence of bits does not identify its own meaning without a convention describing how to interpret it. The same pattern can represent a number, part of a character, a colour component or another value in a larger structure. Students should state the representation before attempting a conversion.

Worked example: number bases

The binary value 101101 represents 32 + 8 + 4 + 1 = 45 in decimal. Grouping into four-bit groups from the right gives 0010 1101, which is hexadecimal 2D. The leading zeroes preserve grouping without changing the positive integer’s value. Each hexadecimal digit corresponds to four binary digits because sixteen equals two to the fourth power.

For a reverse check, hexadecimal 7A represents 7 × 16 + 10 = 122. Its binary form is 0111 1010 when displayed in eight bits. Writing the positional expansion exposes mistakes that can be hidden by a calculator conversion. It also explains why the letters A to F have numerical values in hexadecimal notation.

Characters and bytes are different levels

ASCII provides numerical codes for a limited character set. Unicode provides a much broader system of character identification. An encoding such as UTF-8 determines how Unicode text is represented as bytes. A character count and a byte count therefore need not be equal, particularly for text containing characters outside the basic ASCII range.

When reading a text file, specify an appropriate encoding and preserve the intended characters. A file that appears correct on one machine but becomes unreadable elsewhere may have been interpreted using the wrong convention. Do not solve the problem by silently deleting every unfamiliar character. First determine the intended encoding and the requirements for the data.

Original text-processing example

text = "A中"
encoded = text.encode("utf-8")
print(len(text))
print(len(encoded))
print(encoded.decode("utf-8") == text)

The outputs are 2, 4 and True. In this example, A occupies one UTF-8 byte and the Chinese character occupies three. This does not imply that every displayed symbol always corresponds to one Unicode code point; the example is deliberately simple. The central lesson is that the level being counted must be named.

File processing also needs a record structure. If a line contains several fields, define the delimiter and any quoting convention. Commas inside names or descriptions can make naive splitting unreliable. Use a suitable parser when the file format requires it, and test a record containing an unusual but valid value.

For revision, combine a representation task with a data-quality task. Convert a positive integer by hand, explain the units of storage being counted, and inspect whether a text round trip preserves the original content. These activities connect abstract representations with the practical problem of keeping information intact.

Contents · Previous chapter · Next chapter

CHAPTER 12 OF 18

12. Design databases around relationships and dependencies

Back to contents

A database design should describe the things being recorded and how they relate. Suppose a club records members, books and loans. A member can borrow several books over time, and a book can be borrowed many times. Putting every detail into one wide table may create repeated information and make updates inconsistent.

Consider a loan record containing member ID, member name, book ID, book title and loan date. If a member’s name is repeated in many loan rows, changing it requires several updates. Missing one produces conflicting records. Separating member details from loan events allows the name to be stored in its proper place and referenced through a key.

Choose keys deliberately

A primary key identifies a record uniquely. A foreign key connects a record with a related record in another table. A composite key uses more than one attribute when their combination is the appropriate unique identifier. Names are often poor identifiers because different people can share a name and names can change.

Normalisation examines dependencies rather than merely increasing the number of tables. Ask which attributes depend on the whole key and whether one non-key attribute determines another. A useful third-normal-form design avoids inappropriate transitive dependencies while preserving the relationships needed for the task. State the assumptions, because different business rules can justify different keys.

Original SQLite example

import sqlite3

connection = sqlite3.connect(":memory:")
connection.execute(
    "CREATE TABLE Session (session_id INTEGER PRIMARY KEY, "
    "member TEXT NOT NULL, minutes INTEGER NOT NULL)"
)
connection.executemany(
    "INSERT INTO Session VALUES (?, ?, ?)",
    [(1, "Mira", 18), (2, "Jon", 30), (3, "Mira", 27)]
)
rows = connection.execute(
    "SELECT member, SUM(minutes) FROM Session "
    "GROUP BY member ORDER BY member"
).fetchall()
print(rows)
connection.close()

The output is [('Jon', 30), ('Mira', 45)]. This deliberately small table illustrates aggregation, not the full club schema. The query groups rows by member label, totals their minutes and orders the displayed groups. In a real member database, a stable member ID would distinguish people who share a name.

Understand the difference between selecting rows and aggregating them. A row filter chooses records before grouping, while a group condition can evaluate aggregated results. A join connects related tables according to a relationship. Without the correct join condition, a query can multiply combinations and produce convincing but incorrect totals.

Keep data values separate from SQL instructions

The example binds values using placeholders. The official sqlite3 documentation explains this mechanism. When values come from a user, do not build an SQL instruction by inserting untrusted text into the instruction string. Parameter binding helps preserve the distinction between a value and executable SQL structure.

NoSQL describes a family of approaches rather than one product that is always better than relational databases. A document-oriented design can suit certain evolving or nested records; a relational model can suit structured relationships and queries. Compare the actual needs, consistency expectations and operations. The label alone does not decide the right architecture.

For practice, draw the member, book and loan entities, choose their keys and explain each relationship. Then describe what happens when a book has never been borrowed or a member has several active loans. These cases test whether the design represents the real situation without forcing artificial or duplicated records.

Contents · Previous chapter · Next chapter

CHAPTER 13 OF 18

13. Explain networks as cooperating systems

Back to contents

A network lets systems exchange information according to agreed rules. A local area network connects devices within a relatively limited setting, while wide area connections link systems across larger distances. The internet is a network of interconnected networks. It is useful to distinguish that infrastructure from the web applications that use it.

In a client-server interaction, the client requests a service and the server responds. A browser requesting a page is one example. The same machine can play different roles in different interactions, so “client” and “server” describe responsibilities rather than permanently different kinds of hardware.

Follow a request without skipping the middle

Suppose a student enters a website name. Name resolution helps obtain an address associated with that name. The client then communicates with the relevant service using the applicable protocols. The server processes the request and returns a response, which the browser interprets. Caches and existing connections can change the exact sequence, so avoid claiming that every visit repeats every step from scratch.

An IP address and a domain name serve related but different purposes. A memorable name is useful to people; addressing supports communication between systems. DNS is not the website itself, nor does obtaining an address guarantee that the application at that address is healthy. Troubleshooting improves when these layers are kept separate.

Packets make transmission manageable

Packet switching divides information into units that can travel through a network. Each carries information needed for delivery and interpretation. Routes, congestion and failures can affect arrival. The relevant protocols determine how missing, duplicate or out-of-order information is handled. Do not attribute every reliability feature to “the internet” without identifying the mechanism involved.

Protocols are shared rules about message structure and behaviour. Without them, two devices could exchange electrical signals yet disagree about what the signals mean. A useful analogy is a conversation in which both parties agree on addressing, turn-taking and the format of a request. The analogy helps initially, but the student should return to the concrete network functions when explaining an examination scenario.

Performance depends on more than a single advertised speed. A small request may be affected by delay, while a large transfer can be strongly affected by available throughput. Server processing and application design also matter. A faster local connection does not automatically cure an overloaded remote service.

For a written answer, organise the explanation in causal order. Identify the user action, the network function, the server operation and the resulting response. When discussing a failure, locate it: name resolution, connectivity, server availability or application behaviour. This produces a more useful answer than listing network vocabulary without explaining how the pieces cooperate.

Contents · Previous chapter · Next chapter

CHAPTER 14 OF 18

14. Build a small web application with clear boundaries

Back to contents

A web application joins several responsibilities. HTML describes document structure, CSS controls presentation, and server-side code processes requests and prepares responses. A database can preserve records across requests. Each part has a role, and confusing them makes debugging unnecessarily difficult.

Begin with a tiny interaction before attempting a complete system. A user supplies a quantity, the server checks it, and the response shows a calculated total. The calculation should be a function that can be tested independently. Once that function works, connect it to a route and then to a form.

Original local Flask example

from flask import Flask, request

app = Flask(__name__)

@app.get("/total")
def total_route():
    try:
        quantity = int(request.args.get("quantity", ""))
    except ValueError:
        return "Enter a whole-number quantity", 400
    if not 1 <= quantity <= 12:
        return "Quantity must be from 1 to 12", 400
    return {"quantity": quantity, "total_cents": quantity * 250}

with app.test_client() as client:
    response = client.get("/total?quantity=4")
    print(response.status_code, response.get_json())

The result is status 200 with a JSON object containing quantity 4 and total_cents 1000. Integer cents avoid introducing binary floating-point rounding into this simple money calculation. The example uses a local test client rather than starting a public server. The Flask testing documentation explains how requests can be tested without running a live server.

This is one route, not a complete booking application. It does not persist records, authenticate users or take payment. Keeping its scope explicit allows the student to understand and test its behaviour before adding another responsibility. A larger task should add those components only when the specification requires them.

Client checks do not replace server checks

A browser form can make input easier and catch ordinary mistakes early. The server must still validate the data it receives. Requests can arrive without following the intended form interface. The server is responsible for enforcing the application’s rules regardless of how the request was created.

When building a page, use meaningful labels, readable feedback and a clear relationship between a field and its error message. A colour change alone may not communicate an error to every user. Preserve valid input when another field needs correction, and avoid requiring people to infer a hidden format from repeated failures.

File uploads require additional care. Check the permitted type and size, choose safe storage names and locations, and do not treat a supplied filename as permission to access any path. For classroom work, follow the task’s local setup and school guidance. Do not expose an unfinished exercise publicly merely because it runs on a laptop.

Debug one boundary at a time. Inspect the submitted fields, the server’s parsed values, the database operation and the rendered output. If the calculation is correct in isolation but wrong through the form, the error probably lies in the connection rather than the arithmetic. This method makes a multi-part application manageable.

Contents · Previous chapter · Next chapter

CHAPTER 15 OF 18

15. Connect security and ethics to concrete consequences

Back to contents

Security is easier to understand when the protected property is named. Confidentiality concerns who can access information. Integrity concerns whether information remains trustworthy and appropriately unchanged. Availability concerns whether authorised users can obtain the service or data when needed. One incident can affect several properties, but the distinction helps select a relevant safeguard.

Consider a club booking system. Publishing private member details harms confidentiality. Altering the booking count can harm integrity. Making the service unreachable harms availability. Encryption, access control, validation and backups have different jobs; no single control solves every problem. Explain the threat, the mechanism of the control and the remaining limitation.

Distinguish related security tools

Authentication checks a claimed identity, while authorisation decides what that identity is allowed to do. A successfully signed-in member should not automatically gain permission to edit every other member’s records. Test permissions at the relevant operation, rather than relying only on the presence of a login screen.

Encryption transforms information so that the appropriate key is needed to recover it. A cryptographic hash produces a digest used in suitable integrity-related constructions. A digital signature uses asymmetric cryptography to support checks on origin and integrity under the relevant trust assumptions. These tools are related but not interchangeable, and encryption alone does not automatically establish every property a system needs.

Prepared SQL statements help separate instructions from values. Cross-site request forgery protections help distinguish legitimate state-changing requests from certain unwanted requests made through a user’s browser. File permissions limit which operations are allowed on stored resources. Describe the vulnerability and its matching defence without treating a general input check as a universal cure.

Use lawful, responsible examples

The syllabus names Singapore laws including the Computer Misuse Act, POFMA, the Protection from Harassment Act and the PDPA. In study, distinguish unauthorised system activity, harmful online conduct, falsehood-related situations and personal-data handling rather than applying one label to everything. Legal conclusions depend on facts and current law; use the official materials when a task requires precise legal analysis.

The PDPC’s official guidance explains collection, use and disclosure of personal data. For a student project, begin by asking whether real personal data is needed at all. Invented records often allow the same programming ideas to be learned without collecting classmates’ private details.

Ethical analysis should identify stakeholders and consequences. A convenient data-sharing feature may create risks for people who did not expect their information to travel further. A model with high average accuracy may still perform poorly for a particular group. Explain who benefits, who bears the risk, and what practical design change could improve the situation.

Security learning should occur in authorised classroom environments and with benign examples. The educational goal is to understand mechanisms, prevent weaknesses and evaluate safeguards. A student’s curiosity does not grant permission to test another person’s account, device or website.

Contents · Previous chapter · Next chapter

CHAPTER 16 OF 18

16. Learn machine learning through data and evaluation

Back to contents

Traditional programming often begins with rules written explicitly by a programmer. In machine learning, a system’s behaviour is fitted or organised using data and a chosen method. This does not remove human decisions. People still select the problem, define the data, choose a model and decide whether its performance is useful and responsible.

Supervised learning uses examples with target labels or values. Unsupervised learning seeks structure without those target labels. A classification task predicts a category; clustering groups observations according to the chosen representation and method. A cluster is not automatically a meaningful real-world category simply because an algorithm has assigned it a number.

Original nearest-neighbour example

from sklearn.neighbors import KNeighborsClassifier

features = [[1], [2], [3], [8], [9], [10]]
labels = ["low", "low", "low", "high", "high", "high"]
model = KNeighborsClassifier(n_neighbors=3)
model.fit(features, labels)
print(model.predict([[2.5], [8.5]]).tolist())

The output is ['low', 'high']. This tiny invented dataset makes the voting idea visible; it does not establish useful performance on a real classification problem. Each input row is a sample and each column is a feature. The three nearest stored examples vote according to the configured method. See the official classifier documentation for the interface.

Feature scales matter in distance-based methods. If one feature ranges across thousands and another across fractions, the larger scale can dominate a distance calculation unless handled appropriately. Scaling choices should be learned from the training data and applied consistently. Using information from the test set during preparation can make evaluation misleading.

Clustering is a different question

For one-dimensional observations 1, 2, 3, 9, 10 and 11, a two-cluster grouping can place the first three together and the last three together, with centres 2 and 10. K-means alternates between assigning observations to centres and updating centres. Initialisation and the selected number of clusters can affect the result. Cluster labels such as zero and one do not have an inherent order or meaning.

The official KMeans documentation describes parameters including cluster count, initialisation and random state. Setting a random state can make an exercise reproducible under the same environment, but reproducibility does not prove that the chosen clustering is substantively useful.

Evaluate on data that was not used to fit the model

A model can perform impressively on examples it has already seen. Reserve suitable unseen data for evaluation and compare predictions with known outcomes where the task is supervised. Keep the test set separate from repeated tuning decisions. Otherwise, the model-building process can indirectly adapt to the test examples and overstate future performance.

Accuracy alone can hide a weak solution. If almost every message in a dataset is ordinary, a classifier that predicts “ordinary” for everything may appear accurate while failing to identify the rare unwanted messages. Consider the types of mistakes, their costs and the distribution of examples. Explain limitations rather than reporting one percentage as a complete verdict.

For student work, record the dataset source, feature meanings, preparation steps, model settings and evaluation method. Use invented or appropriately permitted data. When a prediction is surprising, inspect the data and assumptions before describing the system as intelligent or unintelligent. The useful question is what evidence supports its performance on the intended task.

Contents · Previous chapter · Next chapter

CHAPTER 17 OF 18

17. Build a study routine that produces independent solutions

Back to contents

A productive routine alternates between explanation and implementation. After learning a concept, explain it without notes, trace a small example, write a short program and test a changed case. These activities reveal different gaps. A learner may remember a definition but not recognise when it applies, or type a familiar solution without understanding why it works.

Keep an error record with a concrete cause and repair. “Careless mistake” is too broad to guide practice. Record “returned inside the loop”, “used a string instead of an integer”, “forgot the empty queue case” or “joined tables without the relationship condition”. Then solve another task that requires the corrected decision.

FocusActivityEvidence of progress
ConceptExplain an algorithm or representationA clear account of conditions and behaviour
TraceFollow changing values by handA correct trace including a boundary case
BuildImplement a small solutionCode that runs from a clean start
TestCompare expected and actual resultsNormal, boundary and invalid cases
TransferChange one requirementAn adaptation the student can explain
A suggested weekly Computing practice cycle

The cycle is a learning suggestion, not a fixed number of hours. Adjust its size to the school workload. A short session with a clear question can be more productive than a long session that repeatedly runs the same program without investigating why it fails.

Develop a small integrated project

A reading-club tracker can connect several chapters. Begin with a function that totals minutes. Add validation and a dictionary keyed by member ID. Store records in SQLite. Build a local form that submits a reading entry. Add a report that groups totals. At each stage, preserve earlier test cases and explain the new responsibility.

Do not add machine learning simply to make the project look advanced. First identify a meaningful prediction or grouping question and whether the available data supports it. Some problems are solved more clearly by an ordinary rule or database query. Choosing a simpler appropriate method is a sign of understanding.

Practise the assessment environment

Use the school’s permitted setup and reference resources. Learn how to save the required files, restart a notebook kernel and run the work in a reliable order. A notebook can appear successful because an earlier hidden execution left variables in memory. Restarting and running from the beginning checks whether the saved sequence is self-contained.

When practising under time limits, allow time to inspect outputs and filenames. If a task stalls, save a working partial solution and move to another required task where appropriate. Return with a specific hypothesis about the failure. A frantic sequence of untracked edits can destroy a useful starting point.

Parents can ask the student to demonstrate one feature and explain one correction. The goal is to see growing independence, not to demand a polished application every week. If the same conceptual difficulty persists, bring representative code and test results to the teacher. Concrete evidence makes help more targeted than a general complaint that Computing is hard.

Contents · Previous chapter · Next chapter

CHAPTER 18 OF 18

18. Answer the questions students and parents ask most

Back to contents

Is H2 Computing only about programming?

No. Programming turns a design into an executable solution, but students also need to reason about data structures, algorithms, representations, databases, networks, security, social consequences and machine learning. A strong practical solution depends on those ideas. Written explanations and design decisions therefore deserve practice alongside code.

Must a student already be an experienced coder?

Check the school’s actual subject-entry conditions. For learning readiness, examine whether the student can follow logic, ask precise questions and improve after feedback. Prior exposure can reduce the initial unfamiliarity, but experience without understanding is not the same as mastery. Begin with small tasks that reveal what the learner can explain independently.

Can students use built-in functions?

Read the task. A built-in operation may be appropriate when the task asks for a useful result, but it may bypass the required work when the task specifically asks for an algorithm’s implementation. The official lab specimen permits built-ins where appropriate unless stated otherwise. The safe learning habit is to understand both the operation and the instruction governing its use.

Why does working code sometimes still need improvement?

One successful run proves only that the program produced that result for that input in that state. It does not establish correctness for all permitted inputs. The solution may also be difficult to read, depend on hidden state, mishandle invalid data or violate a task requirement. Use a test plan and a clear specification to judge more than a single demonstration.

How should students use AI tools while learning?

Follow school rules and assessment restrictions. During permitted study, use assistance in ways that leave the student able to explain, test and reconstruct the solution. Ask for a hint or an explanation of an error, then attempt the repair independently. Submitting code that the student cannot understand can conceal the exact gap that practice was meant to address.

What should the student do after reading this guide?

Choose one current topic and complete one small task without copying a solution. State the expected behaviour, run a normal case and a boundary case, and explain the first difficulty encountered. Use the relevant chapter to repair that difficulty, then change one requirement and try again. Progress becomes visible when a student can adapt a method rather than reproduce it only in its original form.

Official references and scope

This independent guide contains original teaching examples and does not replace the official examination documents. Details were checked on 17 November 2026 for the revised 2027 school-candidate syllabus. Keep the 9569 syllabus, Paper 1 specimen, Paper 2 specimen and Computing reference guide available, and check the documents for the student’s actual examination year when planning a later sitting.

Contents · Previous chapter