TK Study

How to do practical questions

One place for every practical question type: flowcharts, data flow diagrams, structure charts, class diagrams, ERDs, decision trees, storyboards, UI mock-ups, network diagrams, trace tables, pseudocode, Python, SQL and HTML/CSS. Each section has a notation key, a numbered method, a worked example, a marking checklist, the top mistakes and links to try one now.

Methods are general advice built from the course notation and the NESA specification and marking material on the full pages; check symbols with your teacher. Tap a section to open it.

Flowchart

A flowchart shows the steps of an algorithm with standard shapes, read top to bottom. Full page with NESA marking and 3 practice prompts.

Notation key

Start / End (terminator)Process: a calculation or assignmentInput / output: Get, DisplayDecision: a question with Yes and NoexitsSubroutine call (common practice)YesFlow arrow, always with an arrowhead
Flowchart notation key

Method

  1. Read the question and list the steps in order. Underline every decision and every repeat.
  2. Draw Start, then each step down the page, one shape per step. Use the right shape (Get/Display = parallelogram, calculations = rectangle).
  3. Draw each decision as a diamond with exactly two exits, labelled Yes and No.
  4. A loop is an arrow that goes back UP to an earlier step (usually the decision or the Get).
  5. Finish with End. Check every path reaches End and every arrow has an arrowhead.

Worked example

Task. A program asks for a ticket count that must be 1 to 10. Draw a flowchart that repeats the question until the count is valid, then displays it.

Start Get NumTickets NumTickets < 1OR NumTickets > 10 ? Yes Display 'Invalid' No ProcessPurchase End
Flowchart of validating a ticket number from 1 to 10: Start and End are rounded terminators, input and output are parallelograms, the decision is a diamond with Yes and No arrows, and the loop returns to the input

Why it earns marks: Start/End terminators, parallelograms for Get and Display, one diamond with labelled Yes and No, and the No arrow returns to the Get so the loop is visible.

Marking checklist

  • Start and End are rounded terminators
  • Input and output use parallelograms; calculations use rectangles
  • Every decision is a diamond with exactly two labelled exits
  • Loops return to the correct earlier step
  • Every path reaches End; every arrow has an arrowhead
  • Text matches the question (same variable names and conditions)

Top mistakes

  • Decision exits left unlabelled
  • Using a rectangle for Get or Display
  • A loop-back arrow that goes to the wrong shape (for example back to Start or to an initialiser)
  • Two arrows leaving a process
  • No End, or a path that stops in the middle
Data flow diagram (DFD)

A DFD shows how data moves between people, processes and stores. Level 0 is the whole system as one process; Level 1 splits it into numbered processes. Full page with NESA marking and 3 practice prompts.

Notation key

External entity: rectangle, a noun(Customer)1verbProcess: circle, a verb phrase,numbered at Level 1D1Data store: open rectangle, a noun(Orders)Order detailsData flow: labelled arrow with thedata name
Data flow diagram notation key

Method

  1. List the external entities, the processes (verbs), the stores (nouns) and the data that moves.
  2. Level 0: one circle for the system, the entities around it, every flow labelled.
  3. Level 1: number the processes, add stores, then draw each flow from the question one at a time.
  4. Every flow must touch a process. Never join entity to entity, entity to store or store to store.
  5. Check every process has at least one input AND one output, and every arrow is labelled.

Worked example

Task. Draw the Level 0 and Level 1 DFD for a parking system (entities Driver and Attendant).

Driver ParkingSystem Bank Parking request Ticket and receipt Payment request Payment result Level 0: ONE process for the whole system. No data stores. Every flow is labelled with the data (a noun), not an action.
Level 0 data flow diagram (context diagram) for a parking system: external entities are rectangles, the single process is a circle, flows are labelled arrows
Driver 1Recordentry 2Calculatefee 3Processpayment D1Sessions Bank Plate number Entry time Entry time Fee Payment request Payment result Receipt Level 1 breaks the single Level 0 process into numbered processes (circles). Inputs and outputs must still match Level 0.
Level 1 data flow diagram for the parking system: numbered process circles, one data store (open-ended rectangle), one external entity on each side, labelled flows

Why it earns marks: entities as rectangles, numbered process circles named with verbs, an open store, and every arrow labelled with the data it carries.

Marking checklist

  • External entities are rectangles named with nouns
  • Processes are circles named with verb phrases (numbered at Level 1)
  • Data stores are open rectangles named with nouns
  • Every data flow is labelled and has an arrowhead
  • No flow goes straight between two entities, two stores, or an entity and a store
  • Every process has an input and an output

Top mistakes

  • Unlabelled arrows
  • Entity-to-store flows that skip the process
  • A process with only inputs (or only outputs)
  • Naming a process with a noun
  • Mixing levels: stores or sub-processes on a Level 0 diagram
Structure chart

A structure chart shows the modules (subroutines) of a program and how they call each other, with the data passed between them. Full page with NESA marking and 3 practice prompts.

Notation key

Module: rectangle with its name (top =mainline)Call: line from caller down to themodule it callsData couple: arrow with an open circleand the data nameFlag: arrow with a filled circle(true/false control value)Decision: small diamond (module calledonly if a condition is true)Repetition: curved arrow over themodule(s)
Structure chart notation key

Method

  1. Find the mainline (top box) and the tasks it must do.
  2. Place the sub-modules in call order, left to right, each joined to its caller by a line.
  3. For each module decide what data goes in and out. Draw an arrow with an open circle for data and a filled circle for a true/false flag, and label it.
  4. Add a diamond where a module runs only sometimes, and a curved arrow where it repeats.
  5. Check names are short verb phrases and every module is reachable from the mainline.

Worked example

Task. Show a car park program with mainline, decision and repetition.

Run car parkRead plateFind bookingCalculate costTake paymentOpen gatePlate noPlate noBookingBookingFeeFeePaidPaidrepeat for each carKeydata couple (data passed, arrow shows direction)flag (control information, e.g. Paid = true or false)decision (module called only if condition true)repetition (modules repeated)
Structure chart for a car park: the top box is the mainline, sub-modules sit below, small open circles are data couples, a filled circle is a flag, a diamond marks a decision and a curved arrow marks repetition

Why it earns marks: modules below the mainline in call order, labelled data couples, a flag, a decision diamond and a repetition arrow.

Marking checklist

  • Mainline at the top; modules below it
  • Calls shown top to bottom, left to right in order
  • Data couples (open circle) and flags (filled circle) are labelled and point the right way
  • Selection shown with a diamond, repetition with a curved arrow
  • Module names are clear verb phrases

Top mistakes

  • Missing data names on couples
  • Using a filled circle for ordinary data
  • Joining modules sideways instead of through the caller
  • Forgetting the repetition or decision symbol
Class diagram

A class diagram shows classes, what they hold (attributes), what they do (methods) and how they relate. Inheritance moves shared attributes up to a parent. Full page with NESA marking and 3 practice prompts.

Notation key

Nameattributesmethods()Class box: name, attributes, methodsInheritance: hollow triangle points UPto the parent10..*Association with multiplicity (forexample 1 to 0..*)
Class diagram notation key

Method

  1. List the classes and their attributes.
  2. Find attributes that appear in several classes and move them into a parent class (remove the duplicates from the children).
  3. Draw each class as a three-part box: name, attributes, methods.
  4. Join children to the parent with a hollow-triangle arrow pointing up to the parent.
  5. If asked, add associations with multiplicity at each end.

Worked example

Task. Student and Teacher both have a name and an email. Draw a class diagram that removes the repeated attributes.

Personnameemaillogin()StudentstudentIDenrol(subject)TeacherstaffIDmarkWork()SubjecttitlecodeaddStudent()0..*1..*studiesInheritance: hollow trianglepoints at the PARENT (Person).Multiplicity: a Student studies1 or more Subjects (1..*);a Subject has 0 or moreStudents (0..*).
Class diagram: Person is the parent of Student and Teacher (hollow triangle inheritance arrow); Student is associated with Subject with multiplicity 0..* at the Student end and 1..* at the Subject end; each class box has name, attributes and methods

Why it earns marks: shared attributes sit in Person, children only keep their own, the inheritance arrow points up and multiplicity is shown on the association.

Marking checklist

  • Each class has a name, attributes and methods (if asked)
  • Shared attributes appear once, in the parent
  • Inheritance arrows point to the parent with a hollow triangle
  • Associations have multiplicity at both ends (if asked)
  • Every attribute from the question appears exactly once

Top mistakes

  • Repeating inherited attributes in the child classes
  • Arrow pointing the wrong way
  • Forgetting a class from the list
  • Writing methods in the attribute section
ERD and database schema

An entity relationship diagram shows the tables in a database and how they link through keys. Full page with NESA marking and 3 practice prompts.

Notation key

CustomerPK idEntity (table): name, then attributes;PK = primary key, FK = foreign keyCrow’s foot: the three-line end meansmany; the bar means one
Entity relationship diagram notation key

Method

  1. List the entities (nouns the system stores) and their attributes.
  2. Choose a primary key for each entity.
  3. For each relationship decide one-to-many (the many side holds the foreign key) or many-to-many (add a linking table).
  4. Draw the crow’s foot on the many end and mark PK and FK.
  5. Check every foreign key matches a primary key in the other table.

Worked example

Task. Customers place orders and each order is for one product. Draw the ERD.

CustomerCustID (PK)CustNameEmailOrderOrderID (PK)CustID (FK)ProductID (FK)QuantityProductProductID (PK)ProductNamePriceplacesis ordered inOne Customer places many Orders. One Product appears in many Orders. The foreign key goes on the MANY side.Crow’s foot = many. Double bar = exactly one. Circle = zero (optional). PK = primary key, FK = foreign key.
Entity relationship diagram with crow’s foot notation: Customer one-to-many Order, Product one-to-many Order, with primary and foreign keys marked

Why it earns marks: primary and foreign keys marked, the many end at Order, and no many-to-many relationship left undivided.

Marking checklist

  • Each table has a primary key
  • Foreign keys are on the many side
  • Crow’s foot on the many end of each relationship
  • Many-to-many relationships are split with a linking table
  • Attribute names are clear and consistent

Top mistakes

  • Foreign key on the wrong side
  • Leaving a many-to-many relationship
  • No primary key
  • Crow’s foot drawn at the one end
Decision tree

A decision tree starts at a condition, branches on its answers, and ends at outcomes. Simplify it by removing tests that never change the outcome. Full page with NESA marking and 3 practice prompts.

Notation key

Condition?Decision node: a condition (aquestion)YesBranch: labelled with the answer (Yes/ No, or a value)OutcomeLeaf: the outcome (an action orresult)
Decision tree notation key

Method

  1. List the conditions and the possible outcomes.
  2. Put the most important test (the one that rules out the most) at the top.
  3. Draw two labelled branches for every condition.
  4. End every branch in an outcome.
  5. Simplify: if both branches of a test lead to the same outcome, remove that test.

Worked example

Task. Simplify this tree: the test "Has warranty?" has the same outcome on both branches.

Price under $1000?YesNoHas warranty?Student discount?YesNoYesNoBuyBuyBuyDon't buy
Decision tree before simplifying: both outcomes of Has warranty? are Buy, so that test changes nothing
Price under $1000?YesNoBuyStudent discount?YesNoBuyDon't buy
Simplified decision tree: the Has warranty? test is removed because it did not change the outcome

Why it earns marks: the redundant test is removed and every remaining branch is labelled.

Marking checklist

  • Every condition has labelled branches
  • Every branch ends in an outcome
  • No test whose branches both give the same outcome
  • The tree gives the right outcome for every combination in the question

Top mistakes

  • Unlabelled branches
  • Missing outcomes
  • Keeping tests that change nothing
  • Repeating the same condition on one path
Storyboard

A storyboard is a sequence of screens that shows how a user moves through an app, with arrows labelled by the action. Full page with NESA marking and 3 practice prompts.

Notation key

Screen: a frame with a title and thekey contentTap MenuNavigation: arrow labelled with theuser action
Storyboard notation key

Method

  1. List the screens the user needs, in order.
  2. Draw one frame per screen and title it.
  3. Sketch the main content of each screen (buttons, lists, text).
  4. Join the frames with arrows labelled with the user action that moves between them (Tap Menu, Press Pay).
  5. Check the user can reach the goal and go back.

Worked example

Task. Storyboard a café ordering app from Home to Order summary.

HomeMenuMy ordersMenuBurger $8Salad $7Add to orderOrder summary1 x Burger $8Total $8Pay nowtap Menutap AddFrame 1Frame 2Frame 3One frame per screen, in order. Arrows show the user action that moves between frames. Annotate what each button does.
Storyboard of three screens: Home, Menu, Order summary, with arrows labelled by the user action that moves between them

Why it earns marks: titled screens, content on each, and every arrow says what the user does.

Marking checklist

  • Each screen is titled
  • Key content is shown on each screen
  • Arrows are labelled with the user action
  • The sequence reaches the goal (and shows a way back)

Top mistakes

  • Unlabelled arrows
  • Missing the screen where the goal is reached
  • Too much detail instead of the key content
UI mock-up

A UI mock-up shows what one screen looks like, with the controls a user needs and labels that explain them. Full page with NESA marking and 3 practice prompts.

Notation key

NameText box with a label and hintChooseDrop-down listRememberCheckboxSubmitButtonError messageError message area
User interface control key

Method

  1. Read what the screen must do (inputs, outputs, actions).
  2. Draw a heading and one labelled control for each input.
  3. Choose the right control: text box, drop-down, checkbox, buttons.
  4. Add feedback: hint text, a masked password, and an error message area.
  5. Label or annotate the features the question asks about (consistency, clarity, accessibility).

Worked example

Task. Mock up a registration screen.

Create an accountUsernameEmailPassword• • • • • • • •At least 8 charactersConfirm passwordI agree to the termsError message appears hereRegisterCancelHeading says what the screen is forLabel above every text boxText box (correct type: email)Password characters are maskedHint text before the user errsCheckbox for a yes/no choiceSpace for error feedbackMain action stands out; Cancel is plainer
User interface mock-up for a registration screen with labelled features: heading, labelled text boxes, masked password, hint text, checkbox, error message area, register and cancel buttons

Why it earns marks: every input labelled, a masked password, an error area, and clear Register and Cancel buttons.

Marking checklist

  • Every input has a label
  • The control type suits the data
  • Clear action buttons
  • Hints or error messages are shown
  • Layout is consistent and readable

Top mistakes

  • Unlabelled boxes
  • Using a text box where a list is better
  • No way to submit or cancel
  • Forgetting error feedback
Network diagram

A network or system diagram shows the devices and how they connect, with the protocol on each link. Full page with NESA marking and 3 practice prompts.

Notation key

ServerDevice or server: labelled boxFirewall: filter on the linkInternetThe internet: cloudHTTPSLink: labelled with the protocol
Network diagram notation key

Method

  1. List the devices (client, router, servers, database).
  2. Place the user device on one side and the data on the other.
  3. Draw links between devices that talk to each other.
  4. Label each link with the protocol or data (HTTPS, SQL).
  5. Add security devices (firewall) where the question asks.

Worked example

Task. Show how a client reaches a web server and database.

Clientbrowser or appRouterand firewallInternetWeb serverFlask appDatabaseserverHTTPS requestthen an SQL queryinternal network onlyLabel every device, every connection, and what travels on it (protocol or data). Show where security controls sit (firewall, HTTPS).
Simple network and system diagram: client, router with firewall, the internet, web server, database server, with the protocol labelled on each link

Why it earns marks: all devices labelled, the firewall shown, and the protocol on every link.

Marking checklist

  • Every device is labelled
  • Links join the devices that communicate
  • Protocols are labelled on links
  • Security devices shown where required

Top mistakes

  • Unlabelled links
  • Missing the database or server
  • Drawing the internet as a device
Trace table

A trace table follows the values of the variables line by line so you can find the output or a bug. Full page with NESA marking and 3 practice prompts.

Notation key

counttotalcount <= 4Output
10TRUE
22TRUE

Columns: one for each variable, one for each condition you test, one for Output. Rows: one per step or per loop pass.

Method

  1. Make a column for every variable, every condition tested and Output.
  2. Start with the first line. Write the initial values in the first row.
  3. Work through one line at a time. Add a row each time a value changes or a condition is tested.
  4. Copy unchanged values down so each row is a complete snapshot.
  5. Read the Output column last, and re-check the loop condition on the final pass.

Worked example

Task. Trace this algorithm.

BEGIN Sum
  total = 0
  count = 1
  WHILE count <= 4
    total = total + count * 2
    count = count + 1
  ENDWHILE
  Display total
END Sum
counttotalcount <= 4
10TRUE
22TRUE
36TRUE
412TRUE
520FALSE

Output: 20. The loop ends when count is 5 because 5 <= 4 is FALSE.

Marking checklist

  • A column for every variable and condition
  • Values change one step at a time
  • Loop condition tested on every pass, including the last
  • Output taken from the final row(s)
  • Test data traced one run per row where asked

Top mistakes

  • Skipping the final failed test of the loop
  • Updating two variables in one row when they change on different lines
  • Forgetting initial values
  • Writing the output before the loop ends
Pseudocode

Pseudocode is plain-English code written with a fixed set of keywords. Marks are for correct logic and clear structure, not for syntax. Full page with NESA marking and 3 practice prompts.

Notation key

IdeaHow to write it on this site
Start and endBEGIN Name ... END Name
Input / outputGet x, Display x
Assignmenttotal = total + 1
SelectionIF ... ELSEIF ... ELSE ... ENDIF; CASEWHERE ... END CASE
LoopsWHILE ... ENDWHILE; REPEAT ... UNTIL; FOR i = 0 TO 4 ... NEXT i
SubroutinesBEGIN Name (parameter) ... RETURN value ... END Name

Method

  1. Underline inputs, outputs, decisions and repeats in the question.
  2. Write BEGIN and the name, then initialise variables (counters to 0).
  3. Write the structure first (the loop or IF), then fill in the body.
  4. Indent inside every IF and loop and close it (ENDIF, ENDWHILE, NEXT).
  5. Trace your answer with one example. Fix off-by-one errors in loop bounds.

Worked example

Task. Display how many of the 5 marks in Marks are 50 or more.

BEGIN CountPasses
  count = 0
  FOR i = 0 TO 4
    IF Marks[i] >= 50 THEN
      count = count + 1
    ENDIF
  NEXT i
  Display count
END CountPasses

Why it earns marks: counter starts at 0, every element is visited, the test is exactly "50 or more", and the result is displayed after the loop.

Marking checklist

  • BEGIN/END with the same name
  • Variables initialised before use
  • Correct structure for the logic (IF, loop)
  • Correct conditions and loop bounds
  • Indentation and closing keywords
  • Output in the right place

Top mistakes

  • Displaying inside the loop when it should be after
  • Forgetting to initialise a counter
  • Off-by-one loop bounds
  • Missing ENDIF or ENDWHILE
  • Using = to compare in a way that is unclear
Python

Python questions ask you to read, fix or write short programs. Mark logic first, then syntax. Full page with NESA marking and 3 practice prompts.

Notation key

IdeaPython
Input / outputname = input("Name: "); print(name)
Number conversionint(input()), float(...)
Selectionif x > 5: / elif / else: (colon and indent)
Loopsfor i in range(5):; while x < 10:
Listsmarks = [60, 70]; marks.append(80); len(marks)
Functionsdef add(a, b): ... return a + b

Method

  1. Read the task and decide the inputs, process and output.
  2. Write the structure first: def, loop, or if. Remember the colon and indent.
  3. Convert input with int() or float() when you need numbers.
  4. Run it (or trace it) with a normal case and an edge case.
  5. Fix errors from the message: read the line number and the error name.

Worked example

Task. Ask for a number and print its times table (1 to 12).

n = int(input("Number: "))
for i in range(1, 13):
    print(n, "x", i, "=", n * i)

Why it earns marks: input is converted, the range stops at 12 (range(1, 13)), and the print is inside the loop.

Marking checklist

  • Input is converted to the right type
  • Colons and indentation are correct
  • Loop range matches the question
  • Correct output in the correct place
  • Meaningful variable names

Top mistakes

  • range(1, 12) instead of range(1, 13)
  • Forgetting int() around input
  • Mixing tabs and spaces
  • Printing inside a loop that should print once
SQL

SQL questions ask you to read from tables with SELECT, or change data with INSERT, UPDATE and DELETE. Full page with NESA marking and 3 practice prompts.

Notation key

ClauseUse
SELECT cols FROM tableChoose columns and the table
WHERE conditionFilter rows (comparisons, AND, OR)
ORDER BY col DESCSort the result
GROUP BY col + COUNT/SUM/AVGSummarise groups
JOIN ... ON a.id = b.idCombine tables through a key
INSERT INTO t VALUES (...); UPDATE t SET ... WHERE ...; DELETE FROM t WHERE ...Change data (always use WHERE)

Method

  1. Find the table(s) and the columns the question wants.
  2. Write SELECT and FROM first.
  3. Add WHERE for the filter, then ORDER BY or GROUP BY if needed.
  4. If two tables are needed, JOIN on the matching key column.
  5. For UPDATE and DELETE, write the WHERE first so you do not change every row.

Worked example

Task. List the names and prices of products over $20, most expensive first.

SELECT Name, Price
FROM Products
WHERE Price > 20
ORDER BY Price DESC;

Why it earns marks: the right columns, the table, the exact comparison, and sorted in the direction asked.

Marking checklist

  • Right columns and table
  • WHERE condition matches the wording (> or >=)
  • Sorted or grouped as asked
  • JOIN uses the key columns
  • UPDATE/DELETE have a WHERE

Top mistakes

  • UPDATE or DELETE without WHERE
  • Using = where LIKE or IN is needed
  • Selecting columns not asked for
  • JOIN with no ON condition
HTML and CSS

HTML gives a page its structure. CSS controls how it looks. Questions ask you to read, complete or fix short snippets. Full page with NESA marking and 3 practice prompts.

Notation key

IdeaExample
HTML element<h1>Title</h1>, <p>, <a href="...">, <img src="..." alt="...">
Class and id<p class="note">, <div id="top">
CSS ruleselector { property: value; }
Selectorsp (element), .note (class), #top (id)
Common propertiescolor, background-color, font-size, margin, padding, border

Method

  1. Identify the element or class the question wants to change.
  2. Write the selector, then braces.
  3. Add each property with a colon and end it with a semicolon.
  4. Check the HTML has matching opening and closing tags.
  5. Check the class/id in the CSS matches the HTML exactly.

Worked example

Task. Make every paragraph with class note have a yellow background and 10px padding.

.note {
  background-color: yellow;
  padding: 10px;
}

Why it earns marks: the class selector starts with a dot, and each property ends with a semicolon.

Marking checklist

  • Right selector (dot for class, # for id)
  • Property names and values spelled correctly
  • Colons and semicolons present
  • HTML tags closed
  • Class names match between HTML and CSS

Top mistakes

  • Missing semicolons or braces
  • Writing class="note" in CSS instead of .note
  • Forgetting to close a tag
  • Using a property name that does not exist

All how-to pages · One-page cheat sheet · Software Engineering home