15 Lifetimes questions from the Rust bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.
Free to start: the 2-minute IT readiness check — six questions and a result.
A.a named region of code, written with a leading apostrophe, over which a reference is guaranteed to remain valid
B.a pointer that outlives the data it points to, a bug the compiler statically prevents by rejecting the borrow
C.the set of compiler rules that infer the durations of references in common function signatures so they need not be written explicitly
D.the special region spanning the entire program duration, required for references such as string literals baked into the binary
Answer + AI explanation with Pro
2. Which term means: "a named region of code, written with a leading apostrophe, over which a reference is guaranteed to remain valid"?
Mid
A.Lifetime
B.Lifetime elision
C.Dangling reference
D.Lifetime annotation
Answer + AI explanation with Pro
3. Which statement is correct?
Mid
A.Lifetime — explicit syntax relating the validity regions of input and output references so the compiler can verify none outlives its source
B.Lifetime — the set of compiler rules that infer the durations of references in common function signatures so they need not be written explicitly
C.Lifetime — a pointer that outlives the data it points to, a bug the compiler statically prevents by rejecting the borrow
D.Lifetime — a named region of code, written with a leading apostrophe, over which a reference is guaranteed to remain valid
Answer + AI explanation with Pro
4. What is Dangling reference?
Mid
A.explicit syntax relating the validity regions of input and output references so the compiler can verify none outlives its source
B.the special region spanning the entire program duration, required for references such as string literals baked into the binary
C.a pointer that outlives the data it points to, a bug the compiler statically prevents by rejecting the borrow
D.a named region of code, written with a leading apostrophe, over which a reference is guaranteed to remain valid
Answer + AI explanation with Pro
5. Which term means: "a pointer that outlives the data it points to, a bug the compiler statically prevents by rejecting the borrow"?
Mid
A.Lifetime
B.Dangling reference
C.'static
D.Lifetime elision
Answer + AI explanation with Pro
6. Which statement is correct?
Mid
A.Dangling reference — explicit syntax relating the validity regions of input and output references so the compiler can verify none outlives its source
B.Dangling reference — a pointer that outlives the data it points to, a bug the compiler statically prevents by rejecting the borrow
C.Dangling reference — the special region spanning the entire program duration, required for references such as string literals baked into the binary
D.Dangling reference — the set of compiler rules that infer the durations of references in common function signatures so they need not be written explicitly
Answer + AI explanation with Pro
7. What is 'static?
Mid
A.the set of compiler rules that infer the durations of references in common function signatures so they need not be written explicitly
B.a pointer that outlives the data it points to, a bug the compiler statically prevents by rejecting the borrow
C.a named region of code, written with a leading apostrophe, over which a reference is guaranteed to remain valid
D.the special region spanning the entire program duration, required for references such as string literals baked into the binary
Answer + AI explanation with Pro
8. Which term means: "the special region spanning the entire program duration, required for references such as string literals baked into the binary"?
Mid
A.Dangling reference
B.Lifetime
C.'static
D.Lifetime annotation
Answer + AI explanation with Pro
9. Which statement is correct?
Mid
A.'static — the set of compiler rules that infer the durations of references in common function signatures so they need not be written explicitly
B.'static — a named region of code, written with a leading apostrophe, over which a reference is guaranteed to remain valid
C.'static — a pointer that outlives the data it points to, a bug the compiler statically prevents by rejecting the borrow
D.'static — the special region spanning the entire program duration, required for references such as string literals baked into the binary
Answer + AI explanation with Pro
10. What is Lifetime elision?
Senior
A.explicit syntax relating the validity regions of input and output references so the compiler can verify none outlives its source
B.the set of compiler rules that infer the durations of references in common function signatures so they need not be written explicitly
C.a pointer that outlives the data it points to, a bug the compiler statically prevents by rejecting the borrow
D.a named region of code, written with a leading apostrophe, over which a reference is guaranteed to remain valid
Answer + AI explanation with Pro
11. Which term means: "the set of compiler rules that infer the durations of references in common function signatures so they need not be written explicitly"?
Senior
A.Lifetime
B.Lifetime elision
C.'static
D.Dangling reference
Answer + AI explanation with Pro
12. Which statement is correct?
Senior
A.Lifetime elision — explicit syntax relating the validity regions of input and output references so the compiler can verify none outlives its source
B.Lifetime elision — the set of compiler rules that infer the durations of references in common function signatures so they need not be written explicitly
C.Lifetime elision — a named region of code, written with a leading apostrophe, over which a reference is guaranteed to remain valid
D.Lifetime elision — the special region spanning the entire program duration, required for references such as string literals baked into the binary
Answer + AI explanation with Pro
13. What is Lifetime annotation?
Senior
A.a pointer that outlives the data it points to, a bug the compiler statically prevents by rejecting the borrow
B.explicit syntax relating the validity regions of input and output references so the compiler can verify none outlives its source
C.the special region spanning the entire program duration, required for references such as string literals baked into the binary
D.the set of compiler rules that infer the durations of references in common function signatures so they need not be written explicitly
Answer + AI explanation with Pro
14. Which term means: "explicit syntax relating the validity regions of input and output references so the compiler can verify none outlives its source"?
Senior
A.Lifetime annotation
B.'static
C.Lifetime elision
D.Lifetime
Answer + AI explanation with Pro
15. Which statement is correct?
Senior
A.Lifetime annotation — explicit syntax relating the validity regions of input and output references so the compiler can verify none outlives its source
B.Lifetime annotation — the special region spanning the entire program duration, required for references such as string literals baked into the binary
C.Lifetime annotation — a named region of code, written with a leading apostrophe, over which a reference is guaranteed to remain valid
D.Lifetime annotation — the set of compiler rules that infer the durations of references in common function signatures so they need not be written explicitly
Answer + AI explanation with Pro
Free to start
Start with a free readiness check
Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every Lifetimes question come with Pro.