Skip to content
SPM Tuition
Exam guide

SPM Computer Science assessment and answering guide

You can follow the lessons but lose marks on how the answer is written.

This page shows how to read and answer Computer Science questions. It does not give the paper structure, marks or weightings, because those belong to the official documents from Lembaga Peperiksaan (lp.moe.gov.my) and Bahagian Pembangunan Kurikulum (bpk.moe.gov.my).

Check the current format there before you plan revision. The habits below work for any format.

How do you read what a question wants?

The command word sets the shape of the answer. Underline it before you write anything.

Command What it asks for
State, name, identify A short answer with no reason
Explain A statement plus the reason, using “because”
Trace A table showing each variable as it changes
Write, complete Code or pseudocode, or a missing part of it
Compare Both items, with at least one point of difference
Justify, suggest A choice plus the evidence that supports it
Test Chosen inputs, expected outputs and what each input checks

How do you lay out a trace table?

Give every variable a column, add a row each time a value changes, and write the output separately. The marker can then follow each step and award method marks.

Here is an original algorithm.

total ← 0
FOR i ← 1 TO 5
   IF i MOD 2 = 1 THEN
      total ← total + i
   END IF
END FOR
OUTPUT total
i i MOD 2 = 1 total
start 0
1 true 1
2 false 1
3 true 4
4 false 4
5 true 9

The output is 9. Only the odd values 1, 3 and 5 are added, so 1 + 3 + 5 = 9.

A worked example of how marks are lost

A student skips the table and writes 15, the sum of 1 to 5, without testing the IF. The final answer is wrong, and there is no working to earn method marks.

Another student builds a table but adds to total in every row. The layout is fine, but the IF was ignored. The step that matters is checking the condition on every row.

What habits protect marks?

  1. Read the whole question, then underline the command word.
  2. Copy variable names exactly as they appear.
  3. Write the initial values in a start row before the loop runs.
  4. Test the boundary values, such as the first and last loop values.
  5. Use the same language or pseudocode style the question uses.
  6. Check that your output statement is part of the answer.

For programming and testing skills, use tracing pseudocode step by step and testing normal, boundary and invalid inputs.

How should you practise?

Work questions under time on paper, then mark your answer against what each command word asked. The timed practice session builder sets up a session, and the revision plan suggests which topics to cover first.

Practical and project work is assessed in school, so ask your teacher about it.

If you want a teacher to mark a full answer with you, see online one-to-one Computer Science tuition.

Common questions

Where do I find the current exam format?

Check the Lembaga Peperiksaan (LP) website at lp.moe.gov.my and the Bahagian Pembangunan Kurikulum (BPK) site at bpk.moe.gov.my. Formats and documents can change, so confirm the details for your own exam year there and with your teacher.

Should I write code or pseudocode in my answer?

Follow what the question asks and what your school taught. If it says pseudocode, write structured steps with clear indentation. If it names a language, use that language's syntax. If you are unsure, ask your teacher which style the paper expects.

Do I lose marks for a trace table that is not neat?

An answer that cannot be followed can lose marks even when the final value is right. Give each variable its own column, add one row per change, and write the output at the end so the marker can check each step.

How should I use the time in the paper?

Read every question once, mark the ones you can start immediately, and answer those first. Keep the last few minutes to re-check traces and boundary values. A blank line loses the mark, while an attempt can earn a method mark.

If you understand the code but lose marks on wording and layout, a one-to-one Computer Science lesson lets a teacher mark a full answer of yours and name where each mark went.

  • Online one-to-one lessons for your child with an experienced teacher.
  • Your first class is a one-hour trial, from RM50. The fee is agreed before you book.
  • Happy with the teacher? Continue with lessons of about 1.5 hours. If not, ask for another teacher.