TK Study

Software Engineering › How to answer › drag-into-order (sequencing) questions

How to answer drag-into-order (sequencing) questions

You drag steps into the correct sequence. Find the fixed anchors first (BEGIN/END, loop pairs), then place the rest by asking “what must already exist before this line?” From course notes

What it looks like in the real exam

From NESA material 2025 NESA sample paper 2025 NESA sample exam, Q9: steps of a number-guessing-game algorithm to be placed between BEGIN and END. 2025 familiarisation 2025 NESA familiarisation exam, Q1: order the software development steps (the stem and MG answer are images, so I cannot show them).

From NESA material Partial marks exist. Sample Q9 is worth 2 marks: 2 for the correct order, 1 for correctly ordering just the WHILE and ENDWHILE steps. So place the loop first.

Method

  1. Read the question and any stimulus. Decide what you are ordering: algorithm lines, or stages of a process. From course notes
  2. Fix the anchors. BEGIN is first and END is last. Pairs go together: WHILE…ENDWHILE, IF…ENDIF, REPEAT…UNTIL, FOR…NEXT (NESA pseudocode rules: structural elements come in pairs). From NESA material
  3. Ask “what must exist before this?” A variable must be set before it is tested; a value must be read (Get) before it is compared; a result is shown after the loop ends. General advice
  4. Decide what is inside the loop and what is outside. Things that must repeat go between the loop lines. Things that happen once go before or after. General advice
  5. Drag the steps into order, then read the whole sequence top to bottom out loud as if you were the computer. For a process (not code), read it as a story. From course notes
  6. Re-read the question to confirm every step is used and none is left over. From course notes

Worked example (2025 NESA sample Q9)

2025 NESA sample exam, Q9 · 2 marks

Place the steps of a number guessing game algorithm in the correct order. BEGIN GuessingGame; Set guess = -1; [steps]; END GuessingGame. Steps: Display "Guess a number between 0 and 100:"; Display "Well Done"; Set number = random integer between 0 and 100; WHILE guess <> number; Get guess; ENDWHILE.

Official marking criteria

  • 2 marks: Correctly orders the steps.
  • 1 mark: Correctly orders the WHILE and ENDWHILE steps.

Correct order (reasoned; the NESA MG answer is an image)

Set number = random integer between 0 and 100
WHILE guess <> number
   Display "Guess a number between 0 and 100:"
   Get guess
ENDWHILE
Display "Well Done"

Notes

REASONED (not copied): the MG answer is an image/table that could not be extracted. The prompt/Get guess pair must be inside the loop; 'Well Done' after ENDWHILE.

Open this question page · some of the NESA wording or answer is an image or is unpublished, as noted

  1. Anchors: BEGIN GuessingGame first, END GuessingGame last. WHILE guess <> number goes with ENDWHILE.
  2. Before the loop: Set guess = -1 is already given. Set number = random integer must come before the loop because the loop compares to number.
  3. Inside the loop: the prompt (Display) and Get guess, in that order: you show the prompt, then read the answer. The loop repeats the guess.
  4. After the loop: Display "Well Done" only once the guess matches.

Reasoned Why guess = -1 matters: it makes the WHILE condition true the first time, so the loop runs at least once. See WHILE loop (pre-test).

Common mistakes

  • General advice Putting “Well Done” inside the loop (it would print every time).
  • General advice Setting the random number inside the loop, which changes the answer on each turn.
  • General advice Placing Get before the prompt, or the prompt outside the loop.
  • General advice Ordering the loop lines perfectly but forgetting that the loop pair itself earns the partial mark: do WHILE/ENDWHILE first.

Time per mark

General advice About 1 to 1.5 minutes per mark (2 marks: about 2 to 3 minutes). At the exam average of 1.75 minutes per mark

Practice (4 items, with answers)

Item 1 · the software development steps

Put in order: Test and evaluate; Plan and design; Maintain; Define and understand the problem; Deploy; Develop.

Show the answer

Answer: Define and understand the problem → Plan and design → Develop → Test and evaluate → Deploy → Maintain. This is the cycle from the course (see Software development steps (the order)). From NESA material The actual 2025 familiarisation question (2025 NESA familiarisation exam, Q1) has an image answer, so check against your notes.

Item 2 · original: sum of 1 to 5

Order these lines inside BEGIN Sum … END Sum: NEXT n; Display Total; Total = Total + n; FOR n = 1 TO 5; Total = 0.

Show the answer
BEGIN Sum
    Total = 0
    FOR n = 1 TO 5
        Total = Total + n
    NEXT n
    Display Total
END Sum

Total starts at 0 before the loop; the loop pair holds the addition; the display is after NEXT. Output 15. Original practice

Item 3 · original: validation loop

Order: Get Mark; UNTIL Mark >= 0 AND Mark <= 100; REPEAT; Display "Enter a mark". Which line is first and which is last?

Show the answer
REPEAT
    Display "Enter a mark"
    Get Mark
UNTIL Mark >= 0 AND Mark <= 100

REPEAT first and UNTIL last (post-test loop); the prompt, then Get, inside. Original practice

Item 4 · original: a web request

Order these: Server runs the code and queries the database; Browser displays the page; User submits a form; Server sends back an HTML page.

Show the answer

Answer: User submits a form → Server runs the code and queries the database → Server sends back an HTML page → Browser displays the page. Original practice This is the usual request/response order; check your notes for the wording your course uses.

← How to answer multi-select questions (tick all that apply)How to answer fill-in-the-blank and dropdown questions →