18 real Traits 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 Trait?
Junior
A.a named collection of method signatures defining shared behavior that types can implement
B.a value behind a pointer annotated with dyn that enables dynamic dispatch over any type implementing the behavior, resolved at runtime via a vtable
C.the coherence restriction forbidding an implementation unless either the trait or the type is local to the current crate
D.a syntax in argument or return position denoting some single concrete type implementing the given behavior, resolved statically without a vtable
A.Trait — a value behind a pointer annotated with dyn that enables dynamic dispatch over any type implementing the behavior, resolved at runtime via a vtable
B.Trait — the coherence restriction forbidding an implementation unless either the trait or the type is local to the current crate
C.Trait — a named collection of method signatures defining shared behavior that types can implement
D.Trait — a body provided inside a trait definition that implementors inherit unless they choose to override it
A.Trait bound — a body provided inside a trait definition that implementors inherit unless they choose to override it
B.Trait bound — a constraint on a generic parameter requiring it to implement specified behavior before the code will compile
C.Trait bound — a value behind a pointer annotated with dyn that enables dynamic dispatch over any type implementing the behavior, resolved at runtime via a vtable
D.Trait bound — a syntax in argument or return position denoting some single concrete type implementing the given behavior, resolved statically without a vtable
A.Default method — a named collection of method signatures defining shared behavior that types can implement
B.Default method — a body provided inside a trait definition that implementors inherit unless they choose to override it
C.Default method — a value behind a pointer annotated with dyn that enables dynamic dispatch over any type implementing the behavior, resolved at runtime via a vtable
D.Default method — the coherence restriction forbidding an implementation unless either the trait or the type is local to the current crate
11. Which term means: "a value behind a pointer annotated with dyn that enables dynamic dispatch over any type implementing the behavior, resolved at runtime via a vtable"?
A.Trait object — a constraint on a generic parameter requiring it to implement specified behavior before the code will compile
B.Trait object — a body provided inside a trait definition that implementors inherit unless they choose to override it
C.Trait object — a value behind a pointer annotated with dyn that enables dynamic dispatch over any type implementing the behavior, resolved at runtime via a vtable
D.Trait object — a named collection of method signatures defining shared behavior that types can implement
14. Which term means: "a syntax in argument or return position denoting some single concrete type implementing the given behavior, resolved statically without a vtable"?
A.impl Trait — the coherence restriction forbidding an implementation unless either the trait or the type is local to the current crate
B.impl Trait — a body provided inside a trait definition that implementors inherit unless they choose to override it
C.impl Trait — a syntax in argument or return position denoting some single concrete type implementing the given behavior, resolved statically without a vtable
D.impl Trait — a named collection of method signatures defining shared behavior that types can implement
A.Orphan rule — a constraint on a generic parameter requiring it to implement specified behavior before the code will compile
B.Orphan rule — a syntax in argument or return position denoting some single concrete type implementing the given behavior, resolved statically without a vtable
C.Orphan rule — a body provided inside a trait definition that implementors inherit unless they choose to override it
D.Orphan rule — the coherence restriction forbidding an implementation unless either the trait or the type is local to the current crate
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.