Bebras Mawhiba Computational Thinking Challenge: free practice test

Start with 10 free questions to see what needs more practice. Finish to see your score, weakest units and every option explained.

Back to Bebras Mawhiba Computational Thinking Challenge

Practice test questions with answers and explanations

Try the questions in the test above first, then open each one here to see the correct answer and why every other option is wrong.

01Ten lamps numbered 1 to 10 are all off. In round 1 every lamp is switched; in round 2 every 2nd lamp (2, 4, 6, …) is switched; in round 3 every 3rd lamp; and so on up to round 10. Switching turns an off lamp on and an on lamp off. Which lamps are on at the end?

Practice question Unit: Algorithms and Programming

  1. ALamps 2, 3, 5 and 7

    Prime-numbered lamps have exactly two divisors, so they are switched twice and end up off.

  2. BLamps 1, 2, 4 and 8

    Lamp 2 has divisors 1 and 2 and lamp 8 has four divisors, so both are switched an even number of times.

  3. CLamps 1, 3, 5, 7 and 9

    Being odd does not matter; lamp 3 has divisors 1 and 3, so it is switched twice and ends off.

  4. DLamps 1, 4 and 9 ✓ Correct answer

    A lamp is switched once per divisor; only square numbers have an odd number of divisors, so only 1, 4 and 9 stay on.

Reference: Mawhiba Saudi Bebras Team, Computational Thinking Activity Book Based on Bebras Tasks, Solutions and Explanations, task “Star and Moon Bracelet” (precise instructions and loops), p. 27

02Nine horses must be compared. Each race has exactly 3 horses, and the result shows only the finishing order, not times. A horse always runs at the same speed. What is the fewest number of races that guarantees finding the single fastest horse?

Practice question Unit: Algorithms and Programming

  1. A3

    Three races can rank each group of three, but the three winners have never met, so the fastest is still unknown.

  2. B4 ✓ Correct answer

    Each race can rule out at most 2 horses, and 8 horses must be ruled out: 3 heats plus a winners' race make 4.

  3. C5

    A fifth race is not needed; after the winners' race nobody else can beat the winner of that race.

  4. D9

    Nine counts one race per horse, but a race compares three horses at once and removes two of them.

Reference: Mawhiba Bebras Challenge, past tasks 2015, task “Horse Races”

03A robot starts at (0, 0). U moves it up 1 and R moves it right 1, L moves it left 1. It repeats the same block of 3 moves exactly 4 times. Which block brings it to (4, 8), that is 4 right and 8 up?

Practice question Unit: Algorithms and Programming

  1. AU U U

    This block never moves right, so the robot ends at (0, 12), straight above the start.

  2. BR U L

    The R and L cancel out, so each block only moves 1 up and the robot ends at (0, 4).

  3. CU R U ✓ Correct answer

    One block moves 1 right and 2 up; four blocks move 4 right and 8 up.

  4. DR R U

    This block moves 2 right and 1 up, so four blocks end at (8, 4), with the numbers swapped.

Reference: Mawhiba Bebras Challenge, past tasks 2016, task “Help the Robot”

04Train cars 1, 2 and 3 arrive in that order at a dead-end siding. A car can drive into the siding, and only the car nearest the exit can drive out. Cars may leave at any time. Which leaving order is impossible?

Practice question Unit: Data and Representation

  1. A1, 2, 3

    Each car can drive in and straight out before the next one arrives.

  2. B2, 1, 3

    Cars 1 and 2 drive in, 2 leaves then 1, and finally 3 drives in and out.

  3. C3, 2, 1

    All three drive in, then leave from the exit end: 3, then 2, then 1.

  4. D3, 1, 2 ✓ Correct answer

    For 3 to leave first, 1 and 2 must already be inside with 2 nearer the exit, so 2 must leave before 1.

Reference: Mawhiba Saudi Bebras Team, Computational Thinking Activity Book Based on Bebras Tasks, Solutions and Explanations, task “Sticks” (the stack data structure), p. 26

05A table stores 9 numbers with a check total at the end of each row and below each column. Exactly one of the 9 numbers was copied wrongly; the totals are correct. Rows: 3 5 2 | 10; 4 1 6 | 11; 7 2 9 | 17. Column totals: 14, 8, 16. Which number is wrong, and what should it be?

Practice question Unit: Data and Representation

  1. AThe 6 should be 5

    The 6 is in row 2, whose numbers correctly add up to 11, so it cannot be the error.

  2. BThe 9 should be 8 ✓ Correct answer

    Row 3 adds to 18, not 17, and column 3 adds to 17, not 16; they cross at the 9, which is 1 too big.

  3. CThe 2 in row 3 should be 1

    That 2 is in column 2, which correctly adds up to 8, so changing it would break that column.

  4. DThe 7 should be 6

    Changing the 7 would fix row 3 but break column 1, whose numbers already add up to 14.

Reference: Mawhiba Bebras Challenge, past tasks 2016, task “Checksum”

06A ball moves on a 4 × 4 grid. Each move is written as a digit: 1 = up, 2 = right, 3 = down, 4 = left. The ball starts in row 4 (bottom), column 1 (left) and follows the code 2 1 1 2 3. Where does it stop?

Practice question Unit: Data and Representation

  1. ARow 2, column 4

    This treats the last digit 3 as right; right is 2, while 3 moves the ball down.

  2. BRow 2, column 3

    This is the square before the final 3, which still moves the ball one row down.

  3. CRow 2, column 2

    This treats the last digit 3 as left; in the code 3 means down and 4 means left.

  4. DRow 3, column 3 ✓ Correct answer

    Right to column 2, up twice to row 2, right to column 3, then down to row 3.

Reference: Mawhiba Bebras Challenge, past tasks 2018, task “Path in Digits”

07Five friends meet, and every two of them shake hands exactly once. How many handshakes are there?

Practice question Unit: Graphs and Networks

  1. A5

    Each friend shakes 4 hands, so there are more handshakes than friends.

  2. B10 ✓ Correct answer

    Each of the 5 shakes 4 hands: 5 × 4 = 20, and each handshake was counted twice, so 10.

  3. C20

    20 counts every handshake twice, once for each of the two people.

  4. D25

    25 counts each person pairing with themselves, but handshakes occur only between two different friends.

Reference: Mawhiba Saudi Bebras Team, Computational Thinking Activity Book Based on Bebras Tasks, Solutions and Explanations, task “Neighbours” (graphs: nodes and edges), p. 29

08A garden has four corners A, B, C and D, with paths A–B, B–C, C–D, D–A and A–C. A gardener wants to walk along every path exactly once. Where can the walk start?

Practice question Unit: Graphs and Networks

  1. AOnly at B or at D

    Starting at B or D leaves an odd corner where the walk gets stuck before using every path.

  2. BAt any of the four corners

    That would need every corner to have an even number of paths, but A and C have 3.

  3. CNowhere; such a walk is impossible

    A walk like this is impossible only with more than two odd corners; here there are just two.

  4. DOnly at A or at C ✓ Correct answer

    A and C each have 3 paths, B and D have 2, so the walk starts at one odd corner and ends at the other.

Reference: Mawhiba Saudi Bebras Team, Computational Thinking Activity Book Based on Bebras Tasks, Solutions and Explanations, task “Museum” (modelling rooms and doors as a graph), p. 34

09For inputs A, B and C (each 0 or 1), the output is (A AND NOT B) OR (B AND C). For how many of the 8 input settings is the output 1?

Practice question Unit: Logic and Evaluation

  1. A2

    Two is too small: A=1 with B=0 gives two settings, and B=1 with C=1 gives two more.

  2. B3

    Three misses one setting; the two parts never overlap, so their counts simply add: 2 + 2.

  3. C4 ✓ Correct answer

    A AND NOT B is true in 2 settings (C free), B AND C in 2 (A free); they cannot overlap since B differs: 4.

  4. D6

    Six would need the two parts to cover more settings than they do.

Reference: Mawhiba Saudi Bebras Team, Computational Thinking Activity Book Based on Bebras Tasks, Solutions and Explanations, task “Irrigation” (logic gates), p. 28

10A row has 9 white cells numbered 1 to 9. An antenna placed on a cell covers that cell and the cell on each side of it. Every cell must be covered, no cell may be covered twice, and no wave may go past the ends of the row. Where must the antennas go?

Practice question Unit: Logic and Evaluation

  1. ACells 3, 6 and 9

    Cells 1 is left uncovered and the antenna on 9 spills past the right end.

  2. BCells 2, 4, 6 and 8

    Neighbouring antennas two cells apart cover cells 3, 5 and 7 twice.

  3. CCells 1, 4 and 7

    An antenna on cell 1 would send a wave past the left end of the row, which is not allowed.

  4. DCells 2, 5 and 8 ✓ Correct answer

    Cell 1 can only be covered from cell 2; that covers 1–3, then cell 5 covers 4–6 and cell 8 covers 7–9.

Reference: Mawhiba Bebras Challenge, past tasks 2015, task “Placing Antennas”

Bebras Mawhiba

Full prep for this exam

All of this in one purchase.

  • Full mock exam, same as the real one10 questions in 60 minutes. You get a total score and a score for every unit.
  • Practice unit by unit503 questions, every option explained with its source. Starts with your weakest units.
  • Complete Review Guide 2026–2027 (PDF)Ordered by each unit's weight in the exam. With lifetime access only.

Choose your access

One step before payment

Continue with your Google account and you go straight to the payment page.

Check my score freeFull prep