




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































Question 1. Which Unity method is called exactly once for each script instance when the scene loads, before any Start or Update calls? A) Update B) Awake C) FixedUpdate D) OnEnable Answer: B Explanation: Awake is executed once when the script instance is loaded, making it ideal for initialization that must happen before Start. Question 2. In C#, which keyword is used to make a class member inaccessible from outside its containing class but still accessible to derived classes? A) private B) protected C) internal D) public Answer: B Explanation: protected limits access to the containing class and its subclasses, allowing inheritance while keeping the member hidden from other classes.
Question 3. Which Unity component is required for a GameObject to be affected by the physics engine and respond to forces? A) Collider B) Rigidbody C) Transform D) MeshRenderer Answer: B Explanation: A Rigidbody enables physics simulation on a GameObject, allowing it to react to forces, gravity, and collisions. Question 4. When should you use FixedUpdate instead of Update for applying physics forces? A) When you need to update UI elements B) When you need frame‑rate independent physics calculations C) When you need to handle input events D) When you need to animate character sprites Answer: B Explanation: FixedUpdate runs at a fixed timestep, ensuring consistent physics behavior regardless of frame rate. Question 5. Which C# collection provides O(1) average‑time lookup by a unique key?
B) Image C) Slider D) Toggle Answer: C Explanation: The Slider component provides a draggable handle for selecting a value within a defined range. Question 8. In Unity’s event system, which interface must a script implement to receive pointer click events? A) IBeginDragHandler B) IPointerEnterHandler C) IPointerClickHandler D) IDropHandler Answer: C Explanation: IPointerClickHandler defines the OnPointerClick method that Unity calls when a pointer click occurs. Question 9. Which method is the correct place to cache component references for performance? A) Update B) Awake or Start C) OnGUI
D) LateUpdate Answer: B Explanation: Caching in Awake or Start avoids repeated costly calls like GetComponent during per‑frame updates. Question 10. What does the static keyword indicate when applied to a field in a C# class? A) The field is read‑only after initialization B) The field is shared across all instances of the class C) The field can only be accessed within the same assembly D) The field is automatically serialized by Unity Answer: B Explanation: static fields belong to the class itself, not to any particular instance, so all objects share the same value. Question 11. Which Unity API call loads a new scene asynchronously while allowing the current scene to continue rendering? A) SceneManager.LoadScene B) SceneManager.LoadSceneAsync C) Application.LoadLevel D) AssetBundle.LoadAssetAsync Answer: B
Question 14. In C#, what is the effect of declaring a method with the virtual keyword? A) The method cannot be overridden in derived classes B) The method can be overridden in derived classes using override C) The method is executed on a separate thread D) The method is automatically static Answer: B Explanation: virtual enables polymorphic behavior, allowing derived classes to provide their own implementation with override. Question 15. Which Unity component would you add to a GameObject to make it respond to 2D physics collisions? A) BoxCollider B) Rigidbody2D C) MeshCollider D) CharacterController Answer: B Explanation: Rigidbody2D works with 2D colliders to enable physics interactions in the 2D engine.
Question 16. What is the primary benefit of using a ScriptableObject for storing game data? A) It reduces runtime memory usage because it is not attached to a GameObject B) It automatically synchronizes data across the network C) It provides built-in UI rendering capabilities D) It forces data to be stored in binary format only Answer: A Explanation: ScriptableObjects exist as assets, not as components, allowing shared data without needing a GameObject. Question 17. Which Unity attribute forces a serialized field to be displayed as a read‑only value in the Inspector? A) [HideInInspector] B) [ReadOnly] (custom) C) [SerializeField] D) Unity does not provide a built‑in read‑only attribute; you must create a custom property drawer. Answer: D Explanation: Unity lacks a built‑in read‑only attribute; developers create custom editors or property drawers for this behavior.
A) It allows the method to run on a separate thread automatically B) It provides a way to pause execution and resume on subsequent frames using yield statements C) It forces the method to execute instantly without waiting D) It encrypts the method’s code for security Answer: B Explanation: Coroutines use IEnumerator and yield to suspend execution and continue later, typically across frames. Question 21. Which of the following statements about Unity’s LayerMask is true? A) It can only contain a single layer at a time B) It is used to include or exclude layers in physics queries such as Raycasts C) It automatically changes the rendering order of objects D) It is deprecated in Unity 2020 and later Answer: B Explanation: LayerMask is a bitmask that specifies which layers should be considered in physics operations. Question 22. In C#, what is the result of the expression typeof(int) == typeof(System.Int32)? A) True
B) False C) Compile‑time error D) Runtime exception Answer: A Explanation: int is an alias for System.Int32; both typeof calls return the same System.Type instance. Question 23. Which Unity rendering pipeline feature reduces draw calls by batching objects that share the same material? A) Lightmapping B) GPU Instancing C) Occlusion Culling D) Baked GI Answer: B Explanation: GPU Instancing allows the GPU to draw many instances of a mesh with a single draw call when the material supports it. Question 24. What does the DontDestroyOnLoad method accomplish when called on a GameObject? A) It prevents the object from being destroyed by the garbage collector B) It keeps the object alive across scene loads, preserving its state C) It disables all scripts on the object
D) Set Wrap Mode to Clamp Answer: B Explanation: Reducing the Max Size limits the texture’s resolution, directly decreasing memory consumption on mobile devices. Question 27. Which Unity component is primarily responsible for drawing UI graphics on a Canvas? A) CanvasRenderer B) GraphicRaycaster C) Image D) RectTransform Answer: A Explanation: CanvasRenderer handles the low‑level rendering of UI elements attached to a Canvas. Question 28. In a Unity project using Git, which command stages all modified files for the next commit? A) git push B) git add. C) git commit - m "message" D) git pull Answer: B
Explanation: git add . adds all changes in the current directory to the staging area. Question 29. Which of the following is a correct way to declare a C# property with a private setter? A) public int Score { get; private set; } B) public int Score { private get; set; } C) private int Score { get; set; } D) public int Score; Answer: A Explanation: The syntax public int Score { get; private set; } exposes a public getter while restricting the setter to the class. Question 30. Which Unity method is called after all Update functions have been processed for the current frame? A) LateUpdate B) FixedUpdate C) OnRenderObject D) OnGUI Answer: A Explanation: LateUpdate runs after Update, making it suitable for camera follow logic that depends on objects’ updated positions.
Question 33. In Unity’s Input System, what does the InputAction class represent? A) A specific keycode from the old Input Manager B) A high‑level abstraction of a user‑defined input (e.g., "Jump") that can map to multiple devices C) A physics force applied to a Rigidbody D) A UI button component Answer: B Explanation: InputAction encapsulates a logical action that can be triggered by various input sources (keyboard, gamepad, touch). Question 34. Which C# access modifier makes a member visible only within the same assembly? A) public B) private C) internal D) protected Answer: C Explanation: internal restricts visibility to the current assembly, allowing other scripts in the same project to access it.
Question 35. Which Unity feature allows you to create a reusable set of lighting and post‑processing settings that can be applied to multiple scenes? A) Light Probe B) Render Settings Asset (e.g., GraphicsSettings) C) Lighting Settings asset (saved as a .lighting file) D) Terrain Data Answer: C Explanation: Unity’s Lighting Settings asset stores global lighting and post‑processing configurations that can be reused across scenes. Question 36. When a Rigidbody has its isKinematic property set to true, what is the effect on physics simulation? A) The Rigidbody becomes affected by gravity but not by collisions B) The Rigidbody is completely ignored by the physics engine and can only be moved via script C) The Rigidbody continues to respond to forces but not to torques D) The Rigidbody will automatically snap to the nearest collider surface Answer: B Explanation: A kinematic Rigidbody does not react to physics forces; it must be moved manually, but it can still affect other dynamic bodies through collisions.
Question 39. Which of the following is a valid way to ensure a singleton pattern for a manager class in Unity? A) Declare the class as static and never instantiate it B) Use a private static instance field, a public static property, and assign the instance in Awake with DontDestroyOnLoad C) Place the manager on a GameObject and never reference it again D) Use new keyword inside every script that needs the manager Answer: B Explanation: The classic Unity singleton involves a static instance, assignment in Awake, and optional persistence across scenes. Question 40. What does the SetActive(false) method do to a GameObject and its children? A) Only disables the selected GameObject, leaving children active B) Disables the GameObject and all its children recursively, stopping their Update calls C) Destroys the GameObject immediately D) Converts the GameObject into a prefab Answer: B Explanation: Deactivating a GameObject also deactivates all its descendants, preventing them from receiving updates.
Question 41. Which Unity API call would you use to instantiate a Prefab at runtime? A) GameObject.Load B) PrefabUtility.InstantiatePrefab C) Object.Instantiate D) AssetDatabase.LoadAssetAtPath Answer: C Explanation: Object.Instantiate creates a copy of a prefab (or any Unity object) at runtime. Question 42. In C#, what is the purpose of the using statement when dealing with disposable objects? A) It imports a namespace B) It ensures that Dispose is called automatically when the code block exits, freeing resources C) It creates a new thread for the object D) It makes the object globally accessible Answer: B Explanation: The using block guarantees that Dispose is invoked, releasing unmanaged resources promptly.