Algorithms & Scratch Quiz: Mastering Variables, Loops, and Conditions for Your Exam

Vocabulary and Variables: The Basics You Need to Know

An algorithm is a finite sequence of precise instructions, carried out in a set order. A variable is a named "box" that stores a value: you initialize it ("set x to 0"), assign it ("set x to 5"), or increment it ("add 1 to x"). The most common pitfall is forgetting to initialize a variable at the start of the script, which can crash the program or produce inconsistent results. The easy quiz zeroes in on exactly these habits.

Conditional Statements: The If/Else Block

The "If … then … else …" block runs one branch or the other depending on whether the logical test is true or false. On the exam, you're often asked to predict what a script with a simple condition (equality, comparison) will display, or to identify the right test to solve a problem (like displaying the larger of two numbers, for example). The hard-level questions also work through nested structures: a condition inside a loop.

Loops: Repeat N Times vs. While

This is THE distinction to nail down. "Repeat N times" is a bounded loop: the number of passes is fixed in advance. "While … do" is an unbounded loop: it keeps going as long as a condition is true, so it may stop at an unpredictable point, or never stop at all if the condition never changes — the dreaded infinite loop. Several questions in the quiz focus on tracing through a While loop step by step, a classic question type on exams.

Programming a Geometric Shape with Scratch

Exam questions often use Scratch to have a sprite draw a shape. The key formula to remember: to draw a regular polygon with n sides, you write Repeat n times { move forward by … ; turn by 360°/n }. A square needs 4 iterations and a 90° angle, an equilateral triangle needs 3 iterations and 120°, a hexagon needs 6 and 60°, an octagon needs 8 and 45°, a dodecagon needs 12 and 30°. Watch out: you turn by the EXTERIOR angle of the polygon (the supplement of the interior angle), not the interior angle itself — that's the most common mistake. A pentagram (5-pointed star) requires 144°.

Detecting and Fixing Algorithm Errors

The standard curriculum explicitly requires being able to identify errors in a script: an uninitialized variable, an infinite loop (the tested variable never changes), a faulty condition (a < b instead of a > b in a max-finding algorithm), or an instruction placed outside the loop. Three hard-level questions in the quiz give you practice with this kind of code review, which is a classic feature of official sample exams and recent tests.

Digging Deeper with Other Exam Topics

Play in Timed Mode to Practice Under Exam Conditions

To simulate the pressure of test day, fire up the timed quiz: a limited amount of time per question to help you build speed and accuracy. Every day, the daily quiz serves up a fresh batch across all levels to keep your skills sharp without spending an hour on it every day.

9 quizzes, 90 questions, 3 levels

🌟 Easy
Easy #1
10 questions
Easy #2
10 questions
Easy #3
10 questions
🔥 Medium
Medium #1
10 questions
Medium #2
10 questions
Medium #3
10 questions
💀 Hard
Hard #1
10 questions
Hard #2
10 questions
Hard #3
10 questions

Explore more in science

Top Players — Algorithms & Scratch

Loading...

Test yourself in other categories

Frequently Asked Questions

How many questions does this Algorithms & Scratch quiz have?
The quiz features 90 multiple-choice questions across 9 sets of 10: 30 easy (vocabulary, reading a simple sequence, the "repeat 4 times square" block), 30 medium (tracing execution with "while" loops, regular polygons, choosing the right block), and 30 hard (spotting errors, nested structures, algorithmic problems like summing 1+2+…+N or finding the maximum).
Which Scratch blocks does the quiz cover?
Core blocks from a typical middle-school programming curriculum: variable initialization and assignment ("set x to …"), incrementing ("change by"), "Repeat N times" and "While … do" loops, "If … then … else" conditionals, as well as Motion blocks (move N steps, turn N degrees) and Pen/Looks blocks (show, say) used for drawing shapes.
Do I need Scratch installed to study with this quiz?
No. The questions use readable pseudocode (for example, "Repeat 5 times { … }" or "If x > 10 then … else …") that's strictly equivalent to real Scratch blocks. No installation or connection to Scratch is needed to answer.
Does this quiz really prepare you for algorithm questions on standardized math tests?
Yes. Algorithmic thinking questions show up regularly on standardized middle-school math tests, often as a trace of execution ("what value does the variable end up with?"), completing a script, or identifying a shape. The 90 questions mirror the most common formats found on real exams.
What's the formula for drawing a regular polygon in Scratch?
For a regular polygon with n sides, you write: Repeat n times { move L steps ; turn 360°/n }. Square: 4 turns, 90°. Equilateral triangle: 3 turns, 120°. Hexagon: 6 turns, 60°. Octagon: 8 turns, 45°. Dodecagon: 12 turns, 30°. The sprite turns by the EXTERIOR angle of the polygon, not the interior angle.

Algorithms & Scratch Quiz — Easy #1

Question 1/10
⏱ 0:00
0
/ 10

🏆 Save your score

Appear on this quiz's leaderboard.

Summary of your answers

← Back to levels