This document shows the complete learning experience for the variables-and-types module across Go and TypeScript. Every enhancement from the planning document is now real and ready to use.
Location: tracks/go/exercises/variables-and-types/01-config-loader/
01-config-loader/
├── README.md # Full exercise description with hints
├── starter/
│ ├── config.go # TODO scaffold
│ └── config_test.go # Complete test suite
├── solutions/
│ ├── config.go # Reference implementation
│ ├── config_test.go # Same tests
│ ├── README.md # Solution explanation + complexity analysis
│ └── variants/
│ └── functional.go # Alternative approach (DRY with closures)
└── my-solution/ # Your work goes here
├── config.go # (your implementation)
└── review.md # (self-review notes)
What it teaches:
- Type-safe parsing of string values
- Default values and validation
- Go's explicit error handling
- Struct initialization patterns
Experience:
- Read the README (realistic scenario + constraints)
- Look at starter code + tests
- Implement in
starter/config.go - Run
go testto verify - Compare your solution to
solutions/config.go - Read
solutions/README.mdfor analysis - Check
variants/functional.gofor alternative approach - Write review notes in
my-solution/review.md
Location: tracks/typescript/exercises/variables-and-types/01-config-loader/
Same structure, TypeScript-specific concepts:
- Type-safe parsing with
parseInt,Number() Record<string, string | undefined>for env vars- Strict mode compliance (no
any) - Boolean parsing from strings
Location: tracks/go/exercises/debugging/nil-map-panic/
nil-map-panic/
├── README.md # Symptoms (not the solution!)
├── buggy.go # Code with intentional bug
├── buggy_test.go # Failing test
└── solution.md # Root cause + fix + lessons
The Bug:
type Cache struct {
data map[string]string // uninitialized
}
func (c *Cache) Set(key, value string) {
c.data[key] = value // PANIC: assignment to entry in nil map
}Experience:
- Read symptoms in README (panic message, context)
- Read
buggy.goand form hypotheses - Document your debugging process in README
- Fix the bug
- Run tests to verify
- Compare with
solution.md - Learn the pattern (always use
make()for maps)
Location: tracks/go/exercises/refactoring/type-switch-cleanup/
type-switch-cleanup/
├── README.md # Context + code smells checklist
├── before.go # Working but messy code
├── before_test.go # Tests (must pass before and after)
└── after.go # (TODO: refactored version)
Code Smells Present:
- 90-line function (too long)
- Nested if-else chain
- Type assertions without checking
- Duplicated parsing logic
- Mixed concerns (parsing + validation + business logic)
- Hard to extend (add new event types)
Experience:
- Read
before.goand identify smells - Document what you found
- Refactor incrementally, running tests after each step
- Compare with
after.go(reference refactoring) - Read
analysis.mdfor pattern discussion
Patterns Applied:
- Strategy pattern (handler per event type)
- Dependency injection (handlers registered in map)
- Single Responsibility Principle
- Type-safe parsing with strong types
Two pitfalls created:
Location: vault/pitfalls/go-nil-map-panic.md
Structure:
- The Mistake (code example)
- Why It Happens (mental model gap)
- The Fix (multiple approaches)
- How to Avoid (best practices + tools)
- Comparison to Slices (nil slice behavior)
- Frequency rating (⭐⭐⭐⭐⭐)
- Real-World Impact (production incidents)
- Related concepts (wiki links)
Location: vault/pitfalls/typescript-implicit-any.md
Covers:
- Function parameters without types
- Empty arrays defaulting to
any[] - JSON parsing returning
any - How to enable
noImplicitAny - Comparison to other languages
- Production impact examples
Cross-linked from exercise solutions and vault notes.
Location: vault/interview-prep/by-concept.md
For Variables and Types:
- Conceptual questions: Stack vs heap, value vs reference, type systems
- Language-specific: "Why can you read from nil map?", "What's interface vs type?"
- Debugging: "Why does this panic/throw?"
- Key talking points: Memory management, type safety tradeoffs, null handling
For Hash Maps:
- Linked to LeetCode problems (Two Sum, Group Anagrams, LRU Cache)
- Time complexity analysis
- Collision resolution strategies
Structure:
- One section per module
- Conceptual + language-specific questions
- LeetCode problem mappings
- Key talking points for interviews
- Related curriculum modules
Location: vault/examples/production-patterns/config-management/README.md
What it shows:
- How Kubernetes structures config (logical groups)
- Constructor with defaults pattern
- Validation returning all errors (not just first)
- Completion/enrichment phase (separate from validation)
- Composability and reuse
Sections:
- Overview + source links
- Annotated code extract
- What makes this production-grade (6 aspects)
- Evolution over time (git history)
- Lessons transferable to your code
- Related patterns
Location: vault/rosetta/common-operations.md
Already populated with:
- File I/O (read, write, append, exists)
- HTTP requests (GET, POST with JSON)
- JSON parsing/serialization
- String manipulation (split, join, trim, replace)
- Collections (map, filter, reduce, sort)
- Error handling (try-catch equivalents)
- Concurrency (async task, wait for multiple)
- Testing (basic test, assertion)
All 5 languages side-by-side (Go, TypeScript, Rust, Python, Java)
Format:
| Go | TypeScript | Rust | Python | Java |
|---|---|---|---|---|
| `os.ReadFile(path)` | `fs.readFileSync(path)` | `fs::read_to_string(path)` | `open(path).read()` | `Files.readString(path)` |
Location: curriculum/progress.yaml
Schema includes:
variables-and-types:
go:
status: completed
completed_date: 2026-02-07
last_reviewed: 2026-02-07
review_count: 1
next_review: 2026-02-14 # Auto-calculated
confidence: 4 # 1-5 scale (user sets)
exercises_done: [config_loader, nil_map_debug]
time_spent_minutes: 45Algorithm documented:
- 1st review: +1 day
- 2nd review: +3 days
- 3rd review: +7 days
- 4th review: +14 days
- 5th+ review: +30 days
- Adjust based on confidence (< 3 halve, = 5 double)
Not created yet because config loading happens once at startup. Benchmarks will be added for:
- String manipulation exercises
- Collection operations
- Algorithm implementations
Template exists at vault/templates/solution-readme.md with benchmark section.
Documented in CLAUDE.md but not yet generated.
Will show:
- Dependency graph (variables-and-types → control-flow → functions)
- Completed (green), in-progress (yellow), locked (gray), available (blue)
- Unlocks relationships
- Mermaid diagram generation
- Read lesson.md — tutorial-style, mental models, "Your notes" sections
- Reference reference.md — when you need exact spec behavior
- Do config-loader exercise:
- Read README (realistic scenario)
- Look at starter code + tests
- Implement solution
- Run tests
- Compare with solutions/
- Read variants for alternatives
- Write review notes
- Encounter nil map panic in your own code
- Create pitfall entry immediately (document while fresh)
- Link from vault note for future reference
- Do debugging exercise to practice the pattern
- Do refactoring exercise (webhook handler)
- Identify smells using checklist
- Refactor incrementally
- Compare with reference
- Learn patterns (Strategy, DI)
- Check progress.yaml — next_review date passed
- See notification: "Variables and types (Go) due for review"
- Quick quiz or re-read vault note
- Update confidence level
- Next review scheduled based on confidence
- Check interview-prep/by-concept.md
- See questions mapped to variables-and-types
- Practice explaining stack vs heap, value vs reference
- Try LeetCode problems (if applicable to topic)
- Review pitfalls before interviews
- Complete Go module
- Do TypeScript module
- Read vault note comparing both
- Check Rosetta stone for common operations
- See patterns across languages
Created for Go:
- 1 exercise with 8 files (README, starter, solution, variant, tests)
- 1 debugging exercise (4 files)
- 1 refactoring exercise (3 files, 1 TODO)
- 1 pitfall entry
- 1 production example
Created for TypeScript:
- 1 exercise with 3 files (README, starter, solution)
- 1 pitfall entry
Shared:
- 1 cross-language vault note (variables-and-types)
- 1 interview prep guide
- 1 Rosetta stone (global)
- Progress YAML enhanced schema
Templates ready for future use:
- 10 templates in
vault/templates/
Total: ~30 files created demonstrating the full learning system.
To complete the demo:
- Finish TypeScript config-loader: Add tests and solution variant
- Create TypeScript debugging exercise: Similar to nil-map-panic (maybe undefined property access)
- Complete Go refactoring exercise: Write
after.goandanalysis.md - Add more pitfalls: As you encounter bugs during learning
- Generate concept map: Mermaid diagram from
curriculum/map.yaml - Test spaced repetition: Use progress.yaml to schedule reviews
-
Try the config-loader exercise (Go or TypeScript)
cd tracks/go/exercises/variables-and-types/01-config-loader/starter go test
-
Debug the nil-map-panic
cd tracks/go/exercises/debugging/nil-map-panic go test # watch it panic # fix buggy.go go test # verify fix
-
Browse the vault
- Read
vault/pitfalls/go-nil-map-panic.md - Check
vault/rosetta/common-operations.md - See
vault/interview-prep/by-concept.md
- Read
-
Review production example
- Read
vault/examples/production-patterns/config-management/README.md - See how Kubernetes does config at scale
- Read
-
Compare languages
- Read
vault/fundamentals/variables-and-types.md - See all 6 languages side-by-side
- Read
This is the complete, working system. Every piece we planned is now real code you can use, modify, and learn from.