Coding · Grade 8
Algorithms, Efficiency and Tradeoffs
Learners count the basic operations algorithms perform, classify growth as constant, logarithmic, linear or quadratic from the shape of the code, and predict how running time scales. They explore trading memory for time with sets and caching, and weigh efficiency against input size, frequency, clarity and resources when choosing an approach.
- 4 lessons
- About 85 minutes
- Check what you learned: 8 questions
- Ways to answer: choose an answer, trace code, match pairs, type a number and sort into groups
What learners will discover
- Count the basic operations an algorithm performs for a given input size.
- Classify growth as constant, logarithmic, linear or quadratic from code structure and predict how work scales.
- Explain and trace time-memory tradeoffs such as using a set for lookups or caching results.
- Choose an approach by weighing input size, frequency, correctness, clarity and resources.
Lessons
-
Counting the work an algorithm does 5 steps2 practiceabout 20 min
-
Growth rates 6 steps4 practiceabout 22 min
-
Trading memory for time 5 steps3 practiceabout 20 min
-
Choosing an approach 5 steps3 practiceabout 18 min
-
Check what you learned 8 questions at the end
Keep exploring
Games to practice with
- Bug DetectiveA robot program almost works. Run it, spot the buggy block, and fix it.
- Sorting FactoryTurn a work order into if/else rules and watch the conveyor sort every item.
- Garden AutomationProgram a garden robot with sensor rules — then watch a whole day play out.
More 8th grade coding
- 8th Grade Coding Games4 games to play free
- 8th Grade Coding Worksheets10 printable worksheets
Guide for grown-ups
- How to start homeschooling: a step-by-step guide for familiesA guide for parents · 7 min read