15 real Lifetimes questions from the Rust bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.
1. What is Lifetime?
Mid
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
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
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"?
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
14. Which term means: "explicit syntax relating the validity regions of input and output references so the compiler can verify none outlives its source"?
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
Answers, AI explanations, and a scored voice mock interview
Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.