Diagnostic: what's still there from ch. 1–9

Lesson 0001 · Rust Book chapters 1–9 · no new material, pure retrieval

Your learn-* folders prove you worked through variables, functions, control flow, ownership, borrowing, slices, structs, enums, modules, collections, and error handling. This lesson does not re-teach any of it. It tests what is still retrievable — that is the only kind of "knowing" that helps in an interview or on the job.

How to take this. For each question, think of your answer before revealing it. Grading yourself honestly matters more than "winning" — this diagnostic decides which lessons get built next. Multiple-choice ones grade themselves; short-answer ones ask you to self-grade after reading the answer.

Variables — ch03.1

This code:

let x = 5;
x = 6;
println!("{x}");

Does it compile? If not, what's the fix?

Book: 3.1 Variables and Mutability

Ownership — ch04.1

This code:

let s1 = String::from("hello");
let s2 = s1;
println!("{s1}");

Does it compile? Why or why not?

Book: 4.1 What Is Ownership?

Structs — ch05.3

Given struct Rectangle { width: u32, height: u32 }, where do you define a method like fn area(&self) -> u32?

Book: 5.3 Method Syntax

Error Handling — ch09

What's the real difference between calling panic! and returning Err(...) from a function whose signature returns Result?

Book: 9. Error Handling

Data Types — ch03.2

With no suffix and no other constraint, what type does Rust infer for let x = 5;?

Book: 3.2 Data Types

References & Borrowing — ch04.2

Inside fn calculate_length(s: &String) -> usize, can you modify the String through s?

Book: 4.2 References and Borrowing

Enums & Pattern Matching — ch06.2

Why must a match expression cover every variant of an enum?

Book: 6.2 The match Control Flow Construct

Common Collections — ch08.1

Which type owns and can grow a heap-allocated list of values of the same type?

Book: 8.1 Storing Lists of Values with Vectors

Functions — ch03.3

Does the last expression in a function body need a return keyword to become the return value? What one character must you drop from that line for it to count as an expression, not a statement?

Book: 3.3 Functions

Slices — ch04.3

let s = String::from("hello world");
let hello = &s[0..5];

What Rust type is hello? A slice stores two things internally — what are they?

Book: 4.3 The Slice Type

Modules & Paths — ch07

In your restauran project you called crate::front_of_house::hosting::add_to_waitlist(). What does the pub keyword do to hosting and to add_to_waitlist? What breaks if you remove it?

Book: 7. Packages, Crates, and Modules

Control Flow — ch03.5

Can if sit on the right side of a let to assign a value, like a ternary?

Book: 3.5 Control Flow

Ownership — ch04.1

Name the trait that lets simple stack-only types like i32 get duplicated instead of moved on assignment.

Book: 4.1 What Is Ownership? — Stack-Only Data: Copy

Structs — ch05.3

Why do most struct methods take &self (borrowed) instead of self (owned)?

Book: 5.3 Method Syntax

Common Collections — ch08.3

From your own learn-challenges code:

let x = count.entry(v).or_insert(0);
*x += 1;

What does .entry(v) return, and what does .or_insert(0) do whether v is a new key or an existing one?

Book: 8.3 Storing Keys with Associated Values in Hash Maps

Enums & Pattern Matching — ch06.3

What's the shorthand for a match that only cares about one pattern and ignores every other case?

Book: 6.3 Concise Control Flow with if let

Error Handling — ch09.2

From your own learn-panic code:

let mut username_file = File::open("hello.txt")?;

What does the ? do when File::open returns Err?

Book: 9.2 Recoverable Errors with Result

References & Borrowing — ch04.2

True or false: at any single point, Rust allows either one mutable reference OR any number of immutable references to the same data, never a mix. Why does this rule exist?

Book: 4.2 References and Borrowing

Results

No questions answered yet.

Copying the report and pasting it into the chat is the fastest way to tell the agent what to build next.