Worked Examples & Parsons Problems

For teachers

The Problem with Jumping Straight to Coding

Research in CS education consistently shows that novice programmers struggle when asked to write code from scratch too early. They face simultaneous challenges — syntax, logic, problem decomposition, and tool mechanics — that overwhelm working memory. Worked examples and Parsons problems are two evidence-based strategies that reduce this cognitive load by giving students partial solutions to study and manipulate before writing their own code.

Faded Worked Examples

A worked example is a complete, correct solution to a problem with step-by-step explanations. A faded worked example starts complete and progressively removes pieces, asking the student to fill in the blanks.

For instance, the first example might show a complete function with every line visible and annotated. The second example shows the same pattern but with one line replaced by a blank. The third removes two lines. By the final problem, the student is writing most of the code themselves — but they have seen the pattern enough times that it is familiar.

Fading works because it transitions students gradually from studying to doing. Each step adds a small increment of difficulty rather than a cliff. In Quizzibility, you create faded worked examples using the code-fill step type within an activity sequence. Each step in the sequence can fade more of the solution.

Parsons Problems

A Parsons problem gives students all the lines of code needed to solve a problem, but in a scrambled order. The student's job is to drag the lines into the correct sequence. Some variants include distractor lines (incorrect code) that should not be used.

Parsons problems test understanding of program structure and logic without requiring students to recall exact syntax. They are faster to complete than writing code from scratch, which means you can assign more of them for practice. Research shows that Parsons problems are roughly as effective as code-writing exercises for learning, while taking significantly less time.

When to Use Each

Use worked examples early in a topic, when students are first encountering a pattern or technique. The goal is to build familiarity before asking for production.

Use Parsons problems once students have seen examples but are not yet ready to write code independently. Parsons problems bridge the gap between reading code and writing code.

A well-designed activity sequence might progress: worked example (fully complete) then faded example (one blank) then faded example (multiple blanks) then Parsons problem then write-from-scratch exercise. This progression moves students along the novice-to-competent spectrum with appropriate support at each stage.

Practical Tips

Keep Parsons problems to 6-12 lines of code. Longer problems become tedious drag-and-drop exercises rather than meaningful learning activities. For faded examples, make sure the blanks target the conceptually important parts — not boilerplate like import statements or print formatting.