Class 8 computational thinking
Computational thinking questions for Class 8, with answers
Twelve questions for Class 8 that move from patterns and loops to sorting, binary, logic and how AI finds patterns, each with a clear answer.
How to use this page
A practice set for Class 8
These questions suit students who have met basic algorithms and are ready to trace loops, compare methods and reason about efficiency. Give a few minutes of quiet working time, then let students defend their answers before you reveal the solution.
Patterns and sequences
What comes next? 2, 5, 10, 17, 26, __
37. Each term is a square plus 1: 1+1, 4+1, 9+1, 16+1, 25+1, so the next is 36+1.
Daily temperatures are 28, 30, 32, 31, 33, 35, 34, __. Predict the next value.
36. The changes repeat as +2, +2, -1, so after 34 comes +2.
Write 13 in binary.
1101. That is 8 + 4 + 0 + 1.
Tracing algorithms
sum = 0. For i from 1 to 5: sum = sum + i x i. What is sum at the end?
55. The squares added are 1 + 4 + 9 + 16 + 25.
Show the list 5, 2, 4, 1 after one pass of bubble sort (compare neighbours and swap if the left one is bigger).
2, 4, 1, 5. 5 swaps with 2, then with 4, then with 1, so the biggest number moves to the end.
A grading rule says: 90 or more is A, 75 or more is B, otherwise C. What grade does 80 get?
B. It is not 90 or more, but it is 75 or more.
Efficiency
You must guess a number from 1 to 100. After each guess you are told higher or lower. What is the largest number of guesses you ever need if you always guess the middle?
7 guesses. Each guess halves the range, and 2 to the power 7 is 128, which covers 100 numbers.
Decomposition and abstraction
You are building a simple attendance app for a school. Break it into modules.
Sample answer: student list, daily marking screen, storing records, absence report, alert to parents. Any clear modules with distinct jobs are correct.
You want to model a cricket match scorecard on a computer. Which details do you keep, and which do you ignore?
Keep runs, wickets, overs, batter and bowler names. Ignore weather, crowd size and the colour of the kits. Keeping only what the model needs is abstraction.
Debugging, logic and AI thinking
Bug hunt: to test whether n is even, a program checks if n divided by 2 equals 0. What is wrong?
It should check the remainder, not the quotient. The test is n mod 2 equals 0, so 10 mod 2 is 0 and 10 is even.
For A = true and B = false, what is (A AND B) and what is (NOT A) OR B?
A AND B is false. NOT A is false, and false OR false is false.
A spam filter flags emails with words like 'free prize' and 'click now'. Which computational thinking skill is it using most?
Pattern recognition. It has learned which word patterns often appear in spam.
Teacher notes
Getting more from these questions
Class 8 students can run the sorting and loop questions by hand with cards or a table of values. Ask which method needs fewer steps and why. The AI question is a good way to connect pattern recognition with the AI topics now appearing in CBSE's direction.
Note
Where this guidance comes from
This is Ocoviz's practical guidance, aligned to CBSE's 2026-27 direction. It is not CBSE-official. Always refer to CBSE's own circulars and handbooks for official requirements.
Is your school ready for CBSE's CT and AI direction?
Take the free 3-minute Future-Ready assessment, or book a walkthrough of how Ocoviz tracks thinking skills, not just answers.
Book a Free Demo