Test yourself under real exam conditions: 50 timed questions, 60 on the clock, pass mark 70%%. Instant score with a full review of everything you got wrong. Free — no account needed.
Exam details
Rust is a systems programming language focused on safety, speed, and concurrency. It achieves memory safety without a garbage collector through its ownership system.
Ownership is Rust's core memory management concept. Each value has exactly one owner, and when the owner goes out of scope, the value is dropped (freed). This prevents memory leaks and double frees at compile time.
Borrowing lets you reference a value without taking ownership. You create a reference with &. The original owner retains ownership while the borrower can read (or write, if mutable) the data.
&T is an immutable reference (shared borrow) — multiple allowed simultaneously.&mut T is a mutable reference (exclusive borrow) — only one allowed at a time, and no immutable references may coexist with it.