Enter your book access code

The curriculum, drills, tutor, and interviewer mode are for readers of Ace the Rust Interview. The code is printed in the Preface (Companion site access).

Don’t have the book yet? The landing page stays open — purchase unlocks this gym.

intermediate · order 66

Stack over Vec

list-vec-01Related book chapters: 18 (optional — this page is complete on its own)Vecstack

Slug: list-vec-01 · Paired reading: Chapter 18

Prompt

Implement Stack<T> with push, pop, and peek over a Vec<T>. Feel how the borrow checker helps: peek returns Option<&T> without fighting ownership. Prefer Vec over LinkedList for this shape.