Docsity

Unity Ads Certified Expert Programmer Practice Exam, Exams of Technology

Toggle sidebar
bg1
Unity Ads Certified Expert Programmer
Practice Exam
**Question 1.** Which Unity lifecycle method is called exactly once before any Start methods
are executed?
A) Awake
B) OnEnable
C) Start
D) Reset
Answer: A
Explanation: Awake is invoked when the script instance is being loaded, before any Start calls,
making it ideal for initialization that other scripts might depend on.
**Question 2.** In the new Unity Input System, which class represents a collection of bindings
for a single action?
A) InputActionMap
B) InputBinding
C) InputActionAsset
D) InputControlScheme
Answer: B
Explanation: InputBinding stores the actual device‑specific binding information (e.g., keyboard
key, gamepad button) for an InputAction.
**Question 3.** Which design pattern is most appropriate for providing a globally accessible
game manager while preventing multiple instances?
A) Factory
B) Observer
C) Singleton
D) Command
Answer: C
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

Partial preview of the text

Download Unity Ads Certified Expert Programmer Practice Exam and more Exams Technology in PDF only on Docsity!

Practice Exam

Question 1. Which Unity lifecycle method is called exactly once before any Start methods are executed? A) Awake B) OnEnable C) Start D) Reset Answer: A Explanation: Awake is invoked when the script instance is being loaded, before any Start calls, making it ideal for initialization that other scripts might depend on. Question 2. In the new Unity Input System, which class represents a collection of bindings for a single action? A) InputActionMap B) InputBinding C) InputActionAsset D) InputControlScheme Answer: B Explanation: InputBinding stores the actual device‑specific binding information (e.g., keyboard key, gamepad button) for an InputAction. Question 3. Which design pattern is most appropriate for providing a globally accessible game manager while preventing multiple instances? A) Factory B) Observer C) Singleton D) Command Answer: C

Practice Exam

Explanation: The Singleton pattern ensures a class has only one instance and provides a global point of access, perfect for managers that must be unique. Question 4. When using Addressables, which method loads an asset asynchronously and returns a handle you must release? A) LoadAssetAsync B) InstantiateAsync C) DownloadDependenciesAsync D) Release Answer: A Explanation: LoadAssetAsync loads the asset and returns an AsyncOperationHandle; you must call Release on the handle when finished. Question 5. Which Unity component should be used to detect collision events without applying physics forces? A) Rigidbody B) Collider with isTrigger = false C) Collider with isTrigger = true D) CharacterController Answer: C Explanation: A trigger collider (isTrigger = true) generates OnTriggerEnter/Exit events without responding to physics forces. Question 6. In a State Machine Behaviour attached to an Animator state, which callback is invoked when the state is entered? A) OnStateEnter B) OnStateUpdate

Practice Exam

Question 9. What is the primary advantage of using object pooling for frequently instantiated GameObjects? A) Reduces memory fragmentation B) Improves code readability C) Enables multithreading D) Guarantees deterministic behavior Answer: A Explanation: Object pooling reuses existing objects, avoiding repeated allocations and deallocations, which reduces memory fragmentation and GC spikes. Question 10. Which Unity API is used to schedule a method call after a delay without using coroutines? A) InvokeRepeating B) StartCoroutine C) WaitForSeconds D) Invoke Answer: D Explanation: Invoke schedules a method to be called once after a specified time delay. Question 11. In Unity Ads, which callback is triggered when a rewarded video finishes successfully and the reward should be granted? A) OnAdFailedToLoad B) OnAdClicked C) OnUnityAdsShowComplete D) OnUnityAdsReady Answer: C

Practice Exam

Explanation: OnUnityAdsShowComplete provides the result (e.g., COMPLETED) indicating the user watched the ad fully and is eligible for the reward. Question 12. Which C# collection provides O(1) average‑time lookup by a unique key? A) List B) Queue C) Dictionary<TKey,TValue> D) Stack Answer: C Explanation: Dictionary uses a hash table, giving constant‑time average lookup for keys. Question 13. Which method should you override in a custom editor script to draw the default inspector UI? A) OnInspectorGUI B) DrawDefaultInspector DrawDefaultInspector is a helper method called inside OnInspectorGUI to render the default fields. Answer: B Explanation: Calling DrawDefaultInspector inside OnInspectorGUI renders the standard inspector layout for the target object. Question 14. When using NavMeshAgent, which property defines the radius of the agent for avoidance calculations? A) height B) radius C) baseOffset D) speed

Practice Exam

C) Add a Reflection Probe component D) Use a Standard Shader material Answer: B Explanation: The HDRP Asset must have Ray Tracing enabled; then ray‑traced reflections can be configured via volumes. Question 18. Which Unity API provides a way to run code on a background thread without blocking the main thread? A) IEnumerator B) async/await with Task C) Update D) FixedUpdate Answer: B Explanation: Using async methods returning Task and awaiting them runs the work on a thread‑pool thread, keeping the main thread responsive. Question 19. Which serialization format is most efficient for transmitting large amounts of game state over a network? A) XML B) JSON C) BinaryFormatter D) PlayerPrefs Answer: C Explanation: BinaryFormatter (or a custom binary format) yields compact byte streams, reducing bandwidth compared to text‑based formats.

Practice Exam

Question 20. In Unity’s Physics system, which setting determines whether two layers can collide with each other? A) Rigidbody.collisionDetectionMode B) Physics.IgnoreLayerCollision C) Physics2D.gravity D) Collider.isTrigger Answer: B Explanation: Physics.IgnoreLayerCollision(layer1, layer2, true/false) globally disables or enables collisions between the specified layers. Question 21. Which Unity class is used to create a custom property drawer for a serialized field? A) EditorWindow B) PropertyAttribute C) PropertyDrawer D) CustomEditor Answer: C Explanation: Deriving from PropertyDrawer allows you to control how a specific property type is rendered in the inspector. Question 22. Which coroutine yield instruction pauses execution until the next fixed‑update step? A) WaitForEndOfFrame B) WaitForSeconds C) WaitForFixedUpdate D) null Answer: C

Practice Exam

D) NavMeshLink Answer: A Explanation: NavMeshSurface provides APIs to build or update a NavMesh on the current scene geometry during gameplay. Question 26. Which Unity UI event system class is used to detect pointer clicks on UI elements? A) EventTrigger B) IPointerClickHandler C) Button D) GraphicRaycaster Answer: B Explanation: Implementing IPointerClickHandler on a MonoBehaviour receives OnPointerClick callbacks when the UI element is clicked. Question 27. Which Unity profiling tool shows the order in which draw calls are submitted to the GPU? A) CPU Profiler B) Memory Profiler C) Frame Debugger D) Timeline Answer: C Explanation: The Frame Debugger visualizes each render step, including the sequence of draw calls. Question 28. Which attribute marks a method as a Unity test that can be run by the Unity Test Runner?

Practice Exam

A) [Test] B) [UnityTest] C) [RunTest] D) [TestMethod] Answer: B Explanation: [UnityTest] indicates a coroutine‑based test that can yield and run within the Unity engine context. Question 29. When using the ScriptableObject pattern for game data, which method should you call to create an instance at edit time? A) new ScriptableObject() B) ScriptableObject.CreateInstance() C) Instantiate() D) Resources.Load() Answer: B Explanation: CreateInstance() creates a new ScriptableObject asset that can be saved as an .asset file. Question 30. Which Unity API lets you query whether a specific key was pressed during the current frame? A) Input.GetKeyDown B) Input.GetKeyUp C) Input.GetKey D) Input.GetButtonDown Answer: A Explanation: GetKeyDown returns true only on the frame the key transitions from up to down.

Practice Exam

Answer: B Explanation: SceneManager.sceneLoaded is raised each time a scene finishes loading, regardless of load mode. Question 34. Which design pattern is best suited for decoupling UI button clicks from game logic without a direct reference? A) Observer (UnityEvent) B) Singleton C) Factory D) Mediator Answer: A Explanation: UnityEvent implements the observer pattern, allowing UI components to invoke listeners that are set up in the inspector. Question 35. Which of the following is a recommended practice when writing async code in Unity to avoid race conditions? A) Use Unity’s main thread for all async work B) Lock shared data with a mutex C) Always await the Task before accessing Unity objects D) Use Update to poll for completion Answer: C Explanation: Unity objects must be accessed on the main thread; awaiting ensures the continuation runs on the Unity synchronization context. Question 36. Which Unity class provides a way to draw gizmos only when the game is playing? A) Gizmos

Practice Exam

B) Debug C) Handles D) EditorGUI Answer: A Explanation: Gizmos.Draw* methods are called from OnDrawGizmos and OnDrawGizmosSelected; they render in both edit and play mode, but you can conditionally draw only when Application.isPlaying. Question 37. Which Unity attribute forces a field to be displayed as a read‑only property in the inspector? A) [ReadOnly] (custom) B) [DisableInInspector] C) [HideInInspector] D) Unity does not provide a built‑in read‑only attribute; you must create a custom PropertyDrawer. Answer: D Explanation: Unity has no native read‑only attribute; developers typically implement a custom PropertyDrawer to achieve this behavior. Question 38. When implementing a finite state machine for an NPC, which Unity feature can be used to automatically transition between states based on parameters? A) NavMeshAgent B) Animator Controller C) ScriptableObject D) Timeline Answer: B

Practice Exam

C) null D) WaitForFixedUpdate Answer: A Explanation: WaitUntil evaluates a predicate each frame and resumes when it returns true, perfect for waiting on async operation completion. Question 42. Which Unity API is used to perform a raycast that ignores a specific layer? A) Physics.Raycast with layerMask excluding that layer B) Physics2D.Raycast with ignoreLayer C) Camera.ScreenPointToRay with ignoreLayer D) Physics.RaycastAll and filter results Answer: A Explanation: By providing a layerMask where the unwanted layer’s bit is cleared, Raycast will ignore colliders on that layer. Question 43. In Unity Ads, which method should be called to initialize the SDK on a platform that requires a game ID at runtime? A) Advertisement.Initialize(gameId, testMode) B) UnityAds.Initialize(gameId) C) Advertisement.Load(placementId) D) UnityAds.Initialize() Answer: A Explanation: Advertisement.Initialize takes the game identifier and a testMode flag to start the Ads service. Question 44. Which C# keyword enables a method to be overridden in a derived class?

Practice Exam

A) virtual B) abstract C) override D) sealed Answer: A Explanation: Declaring a method as virtual allows derived classes to provide an override implementation. Question 45. Which Unity UI component should you use to allow a user to scroll through a list of items? A) ScrollRect B) ScrollView C) Slider D) Scrollbar Answer: A Explanation: ScrollRect handles the viewport, content, and optional scrollbars for scrollable UI areas. Question 46. Which of the following is NOT a valid way to improve draw‑call performance on mobile? A) Combine meshes with static batching B) Use GPU instancing C) Increase the number of materials per object D) Reduce overdraw with proper UI ordering Answer: C Explanation: More materials per object increase draw calls; combining meshes or using instancing reduces them.

Practice Exam

Answer: A Explanation: Implementing IPostprocessBuildWithReport lets you execute code after the build finishes. Question 50. Which Unity class is used to store a collection of related assets that can be loaded together via Addressables? A) AssetBundle B) ScriptableObject C) AddressableAssetGroup D) ResourcesFolder Answer: C Explanation: AddressableAssetGroup groups assets for labeling, profiling, and runtime loading. Question 51. Which Unity method is called when a ScriptableObject is first created in the editor? A) OnEnable B) Awake C) Reset D) OnValidate Answer: C Explanation: Reset is invoked when the asset is created or when the user clicks the Reset button in the inspector, allowing default initialization. Question 52. Which of the following Unity components is essential for enabling physics‑based character movement using forces instead of direct transform changes? A) CharacterController B) Rigidbody

Practice Exam

C) NavMeshAgent D) Transform Answer: B Explanation: Rigidbody integrates with the physics engine, allowing forces, torques, and collisions to drive movement. Question 53. Which Unity class provides a low‑level API for manually submitting draw calls? A) Graphics B) GL C) CommandBuffer D) MeshRenderer Answer: C Explanation: CommandBuffer lets you record rendering commands (draw calls, blits, etc.) and execute them at specific pipeline points. Question 54. Which design pattern best fits a system where multiple UI panels need to be opened/closed based on a centralized state machine? A) Observer B) Mediator C) Factory D) Prototype Answer: B Explanation: Mediator centralizes communication between UI components, preventing direct dependencies.