15 Value vs Reference Types questions from the Swift 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.an optimization that defers duplicating backing storage until a shared instance is actually mutated
B.a value type that is copied when assigned or passed, with each copy independent
C.a function on a value type that is marked to allow it to modify the instance's own properties
D.a reference type whose instances are shared, so multiple variables point to the same object
Answer + AI explanation with Pro
2. Which term means: "a value type that is copied when assigned or passed, with each copy independent"?
Junior
A.Mutating method
B.Copy-on-write
C.Struct
D.Value semantics
Answer + AI explanation with Pro
3. Which statement is correct?
Junior
A.Struct — a value type that is copied when assigned or passed, with each copy independent
B.Struct — a function on a value type that is marked to allow it to modify the instance's own properties
C.Struct — a reference type whose instances are shared, so multiple variables point to the same object
D.Struct — an optimization that defers duplicating backing storage until a shared instance is actually mutated
Answer + AI explanation with Pro
4. What is Class?
Junior
A.a value type that is copied when assigned or passed, with each copy independent
B.a function on a value type that is marked to allow it to modify the instance's own properties
C.an optimization that defers duplicating backing storage until a shared instance is actually mutated
D.a reference type whose instances are shared, so multiple variables point to the same object
Answer + AI explanation with Pro
5. Which term means: "a reference type whose instances are shared, so multiple variables point to the same object"?
Junior
A.Value semantics
B.Class
C.Mutating method
D.Copy-on-write
Answer + AI explanation with Pro
6. Which statement is correct?
Junior
A.Class — a function on a value type that is marked to allow it to modify the instance's own properties
B.Class — a reference type whose instances are shared, so multiple variables point to the same object
C.Class — behavior where mutating one variable never affects another that was assigned from it
D.Class — a value type that is copied when assigned or passed, with each copy independent
Answer + AI explanation with Pro
7. What is Value semantics?
Mid
A.behavior where mutating one variable never affects another that was assigned from it
B.a value type that is copied when assigned or passed, with each copy independent
C.an optimization that defers duplicating backing storage until a shared instance is actually mutated
D.a reference type whose instances are shared, so multiple variables point to the same object
Answer + AI explanation with Pro
8. Which term means: "behavior where mutating one variable never affects another that was assigned from it"?
Mid
A.Value semantics
B.Copy-on-write
C.Struct
D.Mutating method
Answer + AI explanation with Pro
9. Which statement is correct?
Mid
A.Value semantics — a function on a value type that is marked to allow it to modify the instance's own properties
B.Value semantics — an optimization that defers duplicating backing storage until a shared instance is actually mutated
C.Value semantics — a value type that is copied when assigned or passed, with each copy independent
D.Value semantics — behavior where mutating one variable never affects another that was assigned from it
Answer + AI explanation with Pro
10. What is Copy-on-write?
Senior
A.a function on a value type that is marked to allow it to modify the instance's own properties
B.a reference type whose instances are shared, so multiple variables point to the same object
C.an optimization that defers duplicating backing storage until a shared instance is actually mutated
D.a value type that is copied when assigned or passed, with each copy independent
Answer + AI explanation with Pro
11. Which term means: "an optimization that defers duplicating backing storage until a shared instance is actually mutated"?
Senior
A.Struct
B.Copy-on-write
C.Class
D.Value semantics
Answer + AI explanation with Pro
12. Which statement is correct?
Senior
A.Copy-on-write — a function on a value type that is marked to allow it to modify the instance's own properties
B.Copy-on-write — an optimization that defers duplicating backing storage until a shared instance is actually mutated
C.Copy-on-write — a reference type whose instances are shared, so multiple variables point to the same object
D.Copy-on-write — behavior where mutating one variable never affects another that was assigned from it
Answer + AI explanation with Pro
13. What is Mutating method?
Mid
A.behavior where mutating one variable never affects another that was assigned from it
B.a reference type whose instances are shared, so multiple variables point to the same object
C.a value type that is copied when assigned or passed, with each copy independent
D.a function on a value type that is marked to allow it to modify the instance's own properties
Answer + AI explanation with Pro
14. Which term means: "a function on a value type that is marked to allow it to modify the instance's own properties"?
Mid
A.Class
B.Struct
C.Mutating method
D.Copy-on-write
Answer + AI explanation with Pro
15. Which statement is correct?
Mid
A.Mutating method — behavior where mutating one variable never affects another that was assigned from it
B.Mutating method — a value type that is copied when assigned or passed, with each copy independent
C.Mutating method — a reference type whose instances are shared, so multiple variables point to the same object
D.Mutating method — a function on a value type that is marked to allow it to modify the instance's own properties
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 Value vs Reference Types question come with Pro.