Docsity

UCAP 720 Unity Certified Associate Programmer Practice Exam, Exams of Technology

Toggle sidebar
bg1
UCAP 720 Unity Certified Associate Programmer
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
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download UCAP 720 Unity Certified Associate Programmer Practice Exam and more Exams Technology in PDF only on Docsity!

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

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 B) Array C) Dictionary<TKey,TValue> D) Queue 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

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?

Practice Exam

A) Update() B) LateUpdate() C) FixedUpdate() D) OnGUI() Answer: C Explanation: FixedUpdate() runs at a fixed timestep used for physics calculations. Question 11. When would you use LateUpdate() instead of Update()? A) To handle input B) To perform physics calculations C) To apply camera follow logic after all Update() calls D) To initialize variables Answer: C Explanation: LateUpdate() runs after all Update() calls, making it ideal for camera positioning based on updated object states. Question 12. Which statement about Coroutines is true? A) They run on a separate thread. B) They can pause execution with yield return. C) They must be declared as static.

Practice Exam

Explanation: Colliders define the shape used for collision detection; without one, physics collisions won’t occur. Question 15. What does GetComponent<Rigidbody>() return if the component is missing? A) Throws an exception B) Returns null C) Returns a default Rigidbody D) Creates a new Rigidbody automatically Answer: B Explanation: GetComponent returns null when the requested component does not exist on the GameObject. Question 16. Which method would you use to destroy a GameObject after 2 seconds? A) Destroy(gameObject, 2f); B) DestroyImmediate(gameObject, 2f); C) GameObject.Destroy(gameObject, 2f); D) Both A and C are correct. Answer: D Explanation: Both syntaxes call UnityEngine.Object.Destroy with an optional delay parameter.

Practice Exam

Question 17. To make a GameObject inactive without destroying it, you should: A) Destroy(gameObject); B) SetActive(false); C) HideFlags = HideFlags.HideInHierarchy; D) Disable(); Answer: B Explanation: SetActive(false) disables the GameObject while keeping it in the scene hierarchy. Question 18. Which Input method retrieves the horizontal axis value defined in the Input Manager? A) Input.GetKey(KeyCode.Horizontal); B) Input.GetAxis("Horizontal"); C) Input.GetButton("Horizontal"); D) Input.GetMouseButton(0); Answer: B Explanation: GetAxis returns a float representing the value of the named axis (e.g.,

  • 1 to 1 for Horizontal).

Practice Exam

B) CreateInstance(prefab); C) new GameObject(prefab); D) Load(prefab); Answer: A Explanation: Instantiate clones the prefab and returns a reference to the new GameObject. Question 22. When you apply changes to a Prefab instance in the scene, how do you propagate those changes back to the original Prefab? A) Apply button in the Inspector B) Save menu option C) Revert button D) Drag the instance onto the Prefab asset Answer: A Explanation: The Apply button writes the modified instance data back to the Prefab asset. Question 23. Which import setting should you adjust to reduce memory usage for a texture used as a UI sprite? A) Max Size B) Compression (e.g., ASTC) C) Generate Mip Maps

Practice Exam

D) Both A and B Answer: D Explanation: Reducing Max Size and using appropriate compression lowers texture memory consumption. Question 24. How can you load an asset at runtime from the Resources folder? A) Resources.Load("AssetName"); B) AssetBundle.LoadAsset("AssetName"); C) Resources.FindObjectOfType<Asset>(); D) AssetDatabase.LoadAssetAtPath("AssetName"); Answer: A Explanation: Resources.Load retrieves assets placed in a Resources folder using a path relative to that folder. Question 25. Which class is used to load scenes asynchronously? A) SceneManager.LoadScene B) SceneManager.LoadSceneAsync C) Application.LoadLevelAsync D) Scene.LoadAsync Answer: B

Practice Exam

Question 28. What exception is thrown when you try to access a component that is null? A) InvalidOperationException B) NullReferenceException C) ArgumentNullException D) MissingComponentException Answer: B Explanation: Accessing members of a null reference triggers a NullReferenceException. Question 29. Which profiling tool provides a visual representation of CPU usage per frame? A) Unity Profiler B) Visual Studio Debugger C) MonoDevelop Profiler D) Windows Task Manager Answer: A Explanation: The Unity Profiler shows detailed CPU, GPU, memory, and rendering statistics per frame. Question 30. To avoid performance issues, which practice is recommended inside Update()?

Practice Exam

A) Call GetComponent every frame B) Instantiate new objects each frame C) Cache component references in Awake() D) Use Debug.Log each frame Answer: C Explanation: Caching references prevents costly lookups and allocations during Update. Question 31. What is object pooling used for? A) Managing memory for textures B) Reusing a set of objects to avoid frequent Instantiate/Destroy C) Organizing scripts in the project hierarchy D) Encrypting saved game data Answer: B Explanation: Object pools keep inactive objects ready for reuse, reducing runtime allocation overhead. Question 32. Which UI component displays a numeric value that can be changed by the player? A) Text B) Image

Practice Exam

Explanation: anchoredPosition defines the offset from the anchor points. Question 35. To change a material’s color at runtime, which code is correct? A) renderer.material.color = Color.red; B) renderer.sharedMaterial.color = Color.red; C) renderer.GetComponent<Material>().color = Color.red; D) renderer.SetColor(Color.red); Answer: A Explanation: renderer.material returns the instance material, allowing per‑object color changes. Question 36. What is the relationship between Mesh, Material, and Shader? A) Mesh stores geometry, Material holds texture data, Shader defines how material is rendered. B) Mesh defines lighting, Material defines vertices, Shader stores UVs. C) Mesh, Material, and Shader are interchangeable. D) Mesh contains shader code. Answer: A Explanation: Mesh = vertices/faces, Material = textures/properties, Shader = GPU program that uses those properties.

Practice Exam

Question 37. Which Animator parameter type triggers a transition without needing a boolean? A) Float B) Int C) Trigger D) Bool Answer: C Explanation: Triggers are set once and automatically reset after the transition, ideal for one‑off events. Question 38. How do you set a trigger parameter named “Jump” on an Animator component? A) animator.SetBool("Jump", true); B) animator.SetTrigger("Jump"); C) animator.Play("Jump"); D) animator.SetInt("Jump", 1); Answer: B Explanation: SetTrigger activates the trigger parameter, causing any transitions that listen for it. Question 39. Which component is required for a GameObject to be affected by Unity’s physics engine?

Practice Exam

C) OnCollisionStay D) OnTriggerStay Answer: B Explanation: Trigger interactions invoke OnTriggerEnter (and related) callbacks, not collision callbacks. Question 42. How can you prevent two specific layers from colliding with each other? A) Use Physics.IgnoreCollision on each pair of colliders. B) Modify the Layer Collision Matrix in Project Settings → Physics. C) Set the colliders to be triggers. D) Change the tag of the GameObjects. Answer: B Explanation: The Layer Collision Matrix lets you enable or disable collisions between layers globally. Question 43. Which method adds a constant force to a Rigidbody each physics step? A) rigidbody.AddForce(force, ForceMode.Force); B) rigidbody.AddForce(force, ForceMode.Impulse); C) rigidbody.velocity = force; D) rigidbody.MovePosition(force);

Practice Exam

Answer: A Explanation: ForceMode.Force applies a continuous force over time, suitable for per‑step additions. Question 44. To move a character without using physics, which component is most appropriate? A) Rigidbody B) CharacterController C) NavMeshAgent D) Transform Answer: B Explanation: CharacterController provides built‑in collision handling for kinematic movement without physics forces. Question 45. Which class is used to store simple key/value pairs between game sessions? A) PlayerPrefs B) JsonUtility C) BinaryFormatter D) ScriptableObject Answer: A