Practice Exam
**Question 1. Which C# data type is best suited for storing a true/false value?**
A) int
B) float
C) bool
D) string
Answer: C
Explanation: The bool type represents Boolean values true or false, which is ideal
for logical conditions.
**Question 2. What will the following C# code output? `int a = 5; a += 3;
Debug.Log(a);`**
A) 5
B) 8
C) 3
D) 0
Answer: B
Explanation: The += operator adds 3 to a, resulting in 8, which is logged.
**Question 3. Which loop is guaranteed to execute at least once?**
A) for
B) while
, UCAP 720 Unity Certified Associate Programmer
Practice Exam
C) do‑while
D) foreach
Answer: C
Explanation: A do‑while loop evaluates its condition after the first iteration,
ensuring one execution.
**Question 4. Which collection provides fast key‑based lookup?**
A) List<T>
B) Array
C) Dictionary<TKey,TValue>
D) Queue<T>
Answer: C
Explanation: Dictionaries store values indexed by keys, offering O(1) lookup time.
**Question 5. In C#, what access modifier makes a member visible only within its
own class?**
A) public
B) protected
C) private
D) internal
Answer: C
, UCAP 720 Unity Certified Associate Programmer
Practice Exam
Explanation: Private members are accessible only inside the declaring class.
**Question 6. Which keyword is used to create a method that does not belong to
a specific instance?**
A) this
B) static
C) virtual
D) abstract
Answer: B
Explanation: Static methods belong to the class itself, not to any instance.
**Question 7. Which principle describes “a class can inherit from only one base
class but implement many interfaces”?**
A) Encapsulation
B) Polymorphism
C) Inheritance
D) Interface segregation
Answer: C
Explanation: C# supports single inheritance for classes while allowing multiple
interface implementations.
, UCAP 720 Unity Certified Associate Programmer
Practice Exam
**Question 8. What is the correct way to declare a property that can be read but
not set from outside the class?**
A) `public int Health { get; set; }`
B) `public int Health { get; private set; }`
C) `public int Health { private get; set; }`
D) `public int Health { get; protected set; }`
Answer: B
Explanation: The private set accessor restricts modification to within the class
while allowing public reads.
**Question 9. Which MonoBehaviour method is called first when a scene
loads?**
A) Start()
B) Awake()
C) Update()
D) OnEnable()
Answer: B
Explanation: Awake() runs before any Start() calls and before the object becomes
enabled.
**Question 10. Which method is called once per physics step, independent of
frame rate?**