Rust Through Problem Solving

Loading...
ProPart of the Pro catalogue.
6 decks74 cards

About this topic

This topic takes a problem-first approach to learning Rust. Instead of memorizing syntax in isolation, you'll reach for Rust's distinctive features — ownership, borrowing, pattern matching, Option and Result — exactly when a problem calls for them.

The 74 exercises are grouped into six themed decks, each building on the one before:

  1. 🔥 Warm-Up Classics — small integer and arithmetic problems that get you writing, compiling, and testing Rust without any new machinery in the way.
  2. 🔤 String Manipulation&str vs String, chars vs bytes, and the everyday transformations: reversing, counting, splitting, encoding.
  3. 📦 Collections & IteratorsVec, HashMap, and HashSet driven by iterator chains: summing, filtering, grouping, and windowing instead of index arithmetic.
  4. 🎯 Pattern Matching & Options — absence and failure modelled in the type system: Option, Result, match, ?, and parsers that can't ignore bad input.
  5. 🔒 Ownership Challenges — in-place mutation through &mut: swapping, partitioning, and rearranging data without cloning your way past the borrow checker.
  6. 🌳 Recursion & Data StructuresBox-based linked lists and trees, graph traversal, and the ownership puzzles recursive structures create.

Every card is a small function you implement against a test suite you run in the browser. Solutions are one click away when you're stuck, and the edge cases in each test teach as much as the happy path.

By the end, you'll have both solid Rust fundamentals — ownership you use on purpose, errors you can't ignore — and a toolkit of solutions to common interview questions.

Decks