Ownership and borrowing
- The three rules: one owner, ownership moves on assignment, the value drops when the owner goes out of scope.
- Move versus copy - why `i32` copies and `String` moves, and what `Clone` versus `Copy` means.
- Borrowing rules: many immutable borrows, or exactly one mutable borrow, never both. Be able to say why this prevents data races at compile time.
- Why does pushing to a vector while holding a reference into it fail? Reallocation would invalidate the reference.
- Slices, and why `&str` is usually the right parameter type rather than `&String`.
Lifetimes
- What a lifetime annotation does - it describes a relationship, it does not change how long anything lives. Candidates frequently get this backwards.
- When must you write one? When the compiler cannot infer which input a returned reference borrows from.
- `'static` - what it means, and why it does not mean leaked.
- The dangling-reference example: returning a reference to a local.
Traits, generics and errors
- Traits versus interfaces, and what the orphan rule prevents.
- Static dispatch with generics versus dynamic dispatch with `dyn` - and the trade-off.
- `Option` and `Result`, and why Rust has no null or exceptions.
- The `?` operator, and implementing `From` so errors convert cleanly.
- When is `unwrap` acceptable? Prototypes, tests, and cases where failure genuinely is a bug - and say so rather than claiming never.
Concurrency and unsafe
`Send` and `Sync` and what each marks, `Arc<Mutex<T>>` as the standard shared-mutable-state pattern, and channels for message passing. Then `unsafe`: what it actually permits (it does not switch off the borrow checker), and when it is justified - FFI, or a data structure the checker cannot verify. The algorithmic half of the loop is the same as any other - see the 15 LeetCode patterns.
How deep it goes by level
- Junior: the fundamentals above, explained clearly. Nobody expects production scars yet, and saying what you have not done reads better than bluffing.
- Mid-level: the same ground plus a crate or service you have written. Expect follow-ups asking why you made a choice rather than whether you know the syntax.
- Senior: unsafe boundaries you have justified, and async runtime choices. The recall questions get shorter and the judgement questions get longer.
Whatever the level, say your answers out loud rather than reading them. Most of what candidates lose in a Rust interview is lost between knowing something and explaining it under observation - the method is in how to use AI for interview prep.
Where CoPilot Interview fits
Disclosure: we build an interview assistant, so treat this as a disclosed pitch. CoPilot Interview is a native Windows and macOS app that puts suggested answers on your own screen in about two seconds, across coding, system design and behavioral rounds, with a permanent free tier that needs no credit card.
Frequently asked questions
What are the most common Rust interview questions?
The ownership and borrowing rules, why a specific snippet fails to compile and how to restructure it, lifetimes and when annotations are required, `Option` and `Result` with the `?` operator, and `Arc<Mutex<T>>` for shared mutable state.
What do lifetime annotations actually do in Rust?
They describe a relationship between the lifetimes of inputs and outputs so the compiler can verify a reference never outlives its data. They do not extend or change how long anything lives, which is the misconception interviewers probe for.
Why can't you modify a vector while holding a reference into it?
Pushing may reallocate the backing buffer, which would leave the existing reference pointing at freed memory. The borrow checker rejects it at compile time, which is the same class of bug that causes use-after-free in C++.
When is it acceptable to use unwrap in Rust?
In prototypes and tests, and in cases where the failure genuinely represents a bug rather than a condition to handle. Claiming you never use it reads as rehearsed; explaining when you would and what you would use instead in production reads as experience.
Walk into the round with a second pair of eyes
CoPilot Interview is a native Windows and macOS app that puts suggested answers on your own screen in about two seconds, across coding, system design and behavioral rounds. The free tier is permanent: 15 minutes a day, no credit card.
Try it free