# Crafting Interpreters, chapter 22

> Week 20 of the cracked.guide path: Ch 22: Local Variables; LeetCode: 2 NeetCode 150 problems.

Week 20 of 145 on cracked.guide, in Crafting Interpreters: Crafting Interpreters 22: Local Variables and 2 NeetCode 150 problems. The reading guides budget about 6 hours.

## Key facts {#key-facts}

- [Crafting Interpreters 22: Local Variables](https://cracked.guide/guide/ci-22): Local variables on the VM stack: the compiler tracks locals and scope depth, so each local is just a stack slot index, making access much faster than hash lookups.
- Phase: Crafting Interpreters, weeks 1 to 28.
- Updated October 20, 2026.

## By the end of this week you can {#objectives}

- Implement locals as stack slots tracked by the compiler.
- Trace endScope as it pops the locals of a finished block.
- Explain why locals are much faster to reach than globals.

## This week's tasks {#tasks}

- [Crafting Interpreters chapter 22, Local Variables](https://cracked.guide/guide/ci-22): about 6 hours
- LeetCode: 2 NeetCode 150 problems

Previous: [Week 19](https://cracked.guide/curriculum/week/19) · Next: [Week 21](https://cracked.guide/curriculum/week/21)

---

Source: https://cracked.guide/curriculum/week/20
cracked.guide: A free, dated 145-week path to getting genuinely cracked at programming.
