Exercises
Hands-on practice to reinforce learning
Philosophy
DevFoundry exercises are contextualized — they appear within the curriculum modules and examples where the concepts are taught. This keeps theory and practice tightly connected.
We believe:
- Practice immediately after learning reinforces concepts
- Context matters — exercises make more sense next to the material they test
- Progressive difficulty — each exercise builds on previous understanding
- Solutions available — but try first, check after
Where to Find Exercises
In Curriculum Modules
Each curriculum module contains exercises integrated into the content:
| Module | Exercises | Focus |
|---|---|---|
| Part I, Module 01: What Software Is | 4 exercises | I/O/P model, predicting output, modification, design |
| Part I, Module 02: Anatomy of Projects | 5 exercises | Language categories, architecture types, project structure, tool chains |
| Part I, Module 03: How the Web Works | 4 exercises | Network inspection, HTML/CSS/JS, HTTP protocol, dev tools |
| Part I, Module 04: Types as Communication | 4 exercises | Adding types, designing types, AI comparison, type errors |
| Part I, Module 05: Build Tools | 4 exercises | package.json, build process, type errors, npm scripts |
| Part I, Module 06: Frontend Frameworks | 4 exercises | Framework problems, component reading, debugging, AI prompts |
Format: Exercises appear with collapsible <details> tags containing solutions. Try the exercise, then expand to check your work.
In Examples
Each example includes practice exercises in its README:
| Example | Exercises | Focus |
|---|---|---|
| Hello World Console | 4 exercises | Modification, parameters, return values, experimentation |
| Lemonade CLI | 4 exercises | Menu data, discount logic, input validation, order IDs |
| Lemonade Static Web | 4 exercises | DOM manipulation, localStorage, animations, keyboard navigation |
| Lemonade CLI (TypeScript) | 4 exercises | Adding menu items, type modifications, AI comparison, type errors |
Format: Exercises build on the working code in the example, encouraging experimentation.
Exercise Types
Type 1: Identify and Analyze
Read code or a scenario and identify patterns.
Example: "Identify the Input, Processing, and Output in this program."
Skills practiced: Pattern recognition, mental model building
Type 2: Predict Output
Look at code and predict what will happen before running it.
Example: "What will this program print?"
Skills practiced: Code reading, execution model understanding
Type 3: Modify and Extend
Take working code and make specific changes.
Example: "Modify the greeting to include the user's name."
Skills practiced: Code modification, experimentation, debugging
Type 4: Design from Scratch
Given a problem, design a solution.
Example: "Design a program that converts temperatures. What are the inputs, processing steps, and outputs?"
Skills practiced: Problem decomposition, architectural thinking
How to Use Exercises
Step 1: Read the Context
Understand the concept being taught before attempting the exercise.
Step 2: Try Without Looking
Attempt the exercise without peeking at the solution. Struggling is part of learning.
Step 3: Check Your Work
Expand the solution and compare. Note differences — understanding why something works differently than expected is valuable.
Step 4: Experiment Further
Don't stop at the solution. What happens if you change something? What if you combine this with a previous exercise?
Using AI for Exercises
When Stuck
If you're stuck after genuine effort, use the debugging prompt template:
I'm working on Exercise 3 in Module 01 (modifying Hello World).
I tried: [what you tried]
Expected: [what you expected]
Got: [what happened]
What am I missing?
After Completing
Ask AI to extend the exercise:
I completed Exercise 3 (adding a name parameter to sayHello).
What's a good next challenge that builds on this?
Creating Your Own Exercises
The best exercise is one you create for yourself:
- Notice something in the curriculum or examples
- Ask "what if" — what if I changed X? Added Y?
- Try it — experimentation is the best teacher
- Reflect — what did you learn?
Exercise Index
Quick reference to all exercises in DevFoundry
Part I: Foundations
Module 01: What Software Is
- Identify I/O/P — Analyze a food ordering app
- Predict Output — What does modified code print?
- Modify Hello World — Add personalization
- Design a Program — Temperature converter
Module 02: Anatomy of Projects
- Language Categories — Classify compiled vs interpreted
- Identify the Architecture — Match apps to architecture types
- Read a Project Structure — Understand lemonade-cli organization
- Tool Chain Matching — Match problems to tools
- Explore a Real Project — Navigate DevFoundry structure
Module 03: How the Web Works
- Observe a Page Load — Use Network tab to analyze requests
- Build a Minimal Page — Create HTML, CSS, JS files
- Inspect HTTP Traffic — Examine request/response headers
- Use Dev Tools — Experiment with Elements and Console
Module 04: Types as Communication
- Add Types to Existing Code — Convert JavaScript to TypeScript
- Design Types for a Feature — Create loyalty program types
- Types and AI Assistance — Compare typed vs untyped AI responses
- Find the Type Error — Spot bugs without running code
Module 05: Build Tools
- Explore package.json — Understand scripts and dependencies
- Understand the Build — Compile TypeScript and examine output
- Break the Build — Introduce type errors and observe behavior
- Add a Script — Create a demo script with preset arguments
Module 06: Frontend Frameworks and React
- Identify the Hard Problems — Find sync issues in vanilla JS
- Read a React Component — Understand props and rendering
- Fix the Bug — Diagnose stale closure issue
- Ask AI for a Component — Practice effective prompting
Example: Hello World Console
- Change the greeting message
- Call the function multiple times
- Add a parameter for the name
- Add a return value
Example: Lemonade CLI
- Add a New Menu Item — Add Frozen Lemonade
- Change the Discount — Modify threshold and percentage
- Add Input Validation — Improve error messages
- Add Order Numbering — Generate unique order IDs
Example: Lemonade Static Web
- Add a Remove All Button — Remove entire item from order
- Persist Order in LocalStorage — Survive page refresh
- Add Animations — Bounce effect when adding items
- Add Keyboard Navigation — Arrow keys and Enter
Example: Lemonade CLI (TypeScript)
- Add a New Menu Item — Extend the typed menu
- Add a Size Option — Modify types and follow compiler errors
- Ask AI to Add a Feature — Compare typed vs untyped prompts
- Type Error Hunt — Find bugs at compile time
Contributing Exercises
Have a good exercise idea? We welcome contributions:
- Match the format — Follow the pattern of existing exercises
- Include solutions — Use
<details>tags for collapsible solutions - Test it — Make sure the exercise is doable and the solution works
- Provide context — Exercises should connect to specific concepts
Remember: The goal isn't to complete exercises perfectly. It's to build understanding through practice. Mistakes are learning opportunities.