

















































































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 C# access modifier restricts a member’s visibility to the class itself and its derived classes? A) public B) private C) protected D) internal Answer: C Explanation: The protected modifier allows access within its own class and any subclass. Question 2. In Unity, which collection type provides O(1) average-time complexity for key‑based lookups? A) ListDictionary implements a hash table, giving constant‑time access for keys. Question 3. Which loop construct guarantees that the body executes at least once? A) for B) while C) do‑while D) foreach Answer: C Explanation: do‑while evaluates its condition after executing the loop body.
Question 4. In C#, which keyword is used to implement multiple inheritance of behavior? A) extends B) implements C) inherits D) interface Answer: B Explanation: A class can implement multiple interfaces using the implements keyword (actually : IInterface in C#; the keyword “implements” is a concept, but the correct term is “interface implementation”). Question 5. Which Unity component is required for an object to react to physics forces? A) Transform B) Collider C) Rigidbody D) MeshRenderer Answer: C Explanation: A Rigidbody enables an object to be driven by Unity’s physics engine. Question 6. To detect a mouse click on a UI Button, which Unity event should you subscribe to? A) OnMouseDown B) OnPointerClick C) OnTriggerEnter D) OnCollisionEnter Answer: B
D) Trigger Answer: C Explanation: A Boolean directly represents a true/false condition such as “isRunning”. Question 10. To display a health bar that updates in real time, which Unity UI component is most appropriate? A) Text B) Image (filled type) C) Slider D) RawImage Answer: B Explanation: An Image set to “Filled” can be adjusted via its fill amount to represent health. Question 11. Which UnityEvent is invoked when a Toggle UI element changes its value? A) onValueChanged B) onClick C) onSubmit D) onDrag Answer: A Explanation: Toggle exposes the onValueChanged UnityEvent for value changes. Question 12. Which design pattern is commonly used for managing game states such as MainMenu, Playing, and Paused? A) Singleton B) Factory C) State Machine
D) Observer Answer: C Explanation: A state machine encapsulates each state’s behavior and transitions. Question 13. Which API call loads a scene asynchronously without freezing the main thread? A) SceneManager.LoadScene B) SceneManager.LoadSceneAsync C) Application.LoadLevel D) AssetBundle.LoadAssetAsync Answer: B Explanation: LoadSceneAsync loads the scene in the background while the game continues running. Question 14. When storing simple player preferences like volume, which Unity class is most suitable? A) PlayerPrefs B) ScriptableObject C) JsonUtility D) BinaryFormatter Answer: A Explanation: PlayerPrefs provides a quick key/value store for primitive data types. Question 15. Which Unity setting determines the scripting runtime version used by the project? A) API Compatibility Level
A) Rigidbody.isKinematic = true B) Rigidbody.useGravity = false C) Rigidbody.interpolation = Interpolate D) Rigidbody.collisionDetectionMode = ContinuousDynamic Answer: A Explanation: A kinematic Rigidbody can be moved manually and will push other dynamic bodies without being affected by forces. Question 19. Which Unity feature allows you to spawn particle systems at runtime with minimal overhead? A) ParticleSystem.Play() on a pre‑instantiated object B) Resources.Load and Instantiate each time C) Using the Particle System’s “Emit” method on an existing component D) Creating a new GameObject with AddComponentEmit can generate particles directly on an existing system without creating new objects. Question 20. In UI layout, which RectTransform property determines the point around which scaling and rotation occur? A) Anchor Min B) Anchor Max C) Pivot D) Size Delta Answer: C Explanation: The Pivot defines the normalized point (0‑1) used for scaling and rotation.
Question 21. Which Profiler module should you examine to find excessive garbage collection spikes? A) CPU Usage B) Rendering C) Memory D) Physics Answer: C Explanation: The Memory module displays allocation patterns and GC events. Question 22. When a NullReferenceException occurs, what is the most likely cause? A) Division by zero B) Accessing an array out of bounds C) Trying to use a variable that hasn't been assigned an instance D) Using an unsupported platform API Answer: C Explanation: A NullReferenceException is thrown when you attempt to dereference a null object. Question 23. Which refactoring technique improves readability by extracting repeated code into a separate method? A) Inline Variable B) Extract Method C) Rename Symbol D) Replace Magic Number with Constant Answer: B
Answer: B Explanation: git branch <name> creates a new branch without switching to it. Question 27. Which Unity service provides a ready‑made solution for displaying rewarded video ads? A) Unity Analytics B) Unity Cloud Build C) Unity Ads D) Unity Multiplayer Answer: C Explanation: Unity Ads offers rewarded video, interstitial, and banner ad formats. Question 28. What is the default value of a newly declared bool field in a MonoBehaviour script? A) true B) false C) null D) undefined Answer: B Explanation: In C#, value types like bool default to false. Question 29. Which LINQ method returns the first element that satisfies a condition or throws an exception if none is found? A) FirstOrDefault() B) Single() C) First()
D) Find() Answer: C Explanation: First() throws InvalidOperationException when no matching element exists. Question 30. To ensure a script runs its Update method only when the game is not paused, which Unity callback should you check? A) Time.timeScale == 0 B) Application.isFocused C) SceneManager.isLoaded D) Input.anyKeyDown Answer: A Explanation: Setting Time.timeScale to 0 pauses the game loop; Update still runs but you can early‑out when the scale is zero. Question 31. Which attribute can be added to a field to make it editable in the Unity Inspector while keeping it private? A) [HideInInspector] B) [SerializeField] C) [NonSerialized] D) [ReadOnly] Answer: B Explanation: [SerializeField] forces Unity to serialize a private field, exposing it in the Inspector. Question 32. When using Resources.Load<T>("Path"), what must be true about the asset’s location? A) It must be inside a folder named “StreamingAssets”.
Question 35. Which UI component is best suited for displaying a scrollable list of items generated at runtime? A) Text B) Dropdown C) ScrollRect with a Vertical Layout Group D) ToggleGroup Answer: C Explanation: ScrollRect combined with a layout group efficiently handles dynamic content. Question 36. Which method is called automatically when a Unity object is destroyed, either by Destroy() or scene unload? A) OnDisable() B) OnDestroy() C) OnApplicationQuit() D) OnDisable() and then OnDestroy() Answer: B Explanation: OnDestroy is invoked just before the object is removed from the scene. Question 37. What does the static keyword indicate when applied to a class member in C#? A) The member is read‑only. B) The member belongs to the class itself rather than an instance. C) The member can only be accessed within the same assembly. D) The member is thread‑safe by default. Answer: B Explanation: static members are shared across all instances of the class.
Question 38. Which Unity API call retrieves the current platform the game is running on? A) Application.platform B) SystemInfo.operatingSystem C) BuildTarget.CurrentPlatform D) RuntimePlatform.GetCurrent() Answer: A Explanation: Application.platform returns a RuntimePlatform enum indicating the active platform. Question 39. When you need to ensure that only one instance of a manager class exists across scenes, which pattern is most appropriate? A) Factory B) Singleton C) Observer D) Decorator Answer: B Explanation: The Singleton pattern restricts a class to a single globally accessible instance. Question 40. Which Unity component is used to trigger code execution when another collider enters its volume? A) Rigidbody B) Collider with isTrigger enabled C) MeshRenderer D) AudioSource Answer: B
C) InputBindingProfile D) ControlScheme Answer: B Explanation: An InputActionAsset holds action maps, actions, and bindings. Question 44. Which attribute can be placed above a method to make it callable from Unity’s UI Button component without a script reference? A) [ContextMenu] B) [ExecuteInEditMode] C) [Button] D) None – you must assign the method manually in the Inspector. Answer: D Explanation: Unity UI Buttons require you to drag a component reference and select a public method; no attribute automates this. Question 45. What does the ? operator do in a C# expression like myObject?.DoSomething()? A) Forces a compile‑time error if myObject is null B) Performs a null‑conditional check and only calls the method if the instance is not null C) Casts myObject to a nullable type D) Marks the method as optional Answer: B Explanation: The null‑conditional operator safely accesses members only when the left‑hand side isn’t null. Question 46. Which Unity API is used to capture a screenshot at runtime?
A) ScreenCapture.CaptureScreenshot B) Application.CaptureScreenshot C) Graphics.Blit D) Texture2D.ReadPixels Answer: A Explanation: ScreenCapture.CaptureScreenshot writes a PNG file of the current frame. Question 47. When using IEnumerator for a coroutine, which statement pauses execution until the next frame? A) yield return null; B) yield return new WaitForSeconds(0); C) yield break; D) yield return true; Answer: A Explanation: yield return null tells Unity to resume the coroutine on the next frame. Question 48. Which Unity editor window allows you to view the hierarchy of assets in a package? A) Project B) Scene C) Package Manager D) Inspector Answer: C Explanation: The Package Manager lists installed packages and their contents.
Question 52. When you need to group several GameObjects under a common transform for collective movement, which Unity feature should you use? A) Prefab B) Empty GameObject as parent C) Layer D) Tag Answer: B Explanation: Parenting objects to an empty GameObject lets you move/rotate them together. Question 53. Which method should you override to customize how a ScriptableObject is created in the editor? A) OnEnable() B) OnValidate() C) CreateAssetMenu attribute D) Reset() Answer: C Explanation: Adding [CreateAssetMenu] to a ScriptableObject class adds a menu entry for creating assets. Question 54. Which Unity rendering feature culls objects that are not visible from the camera’s viewpoint? A) Occlusion Culling B) LOD Group C) Batching D) Light Baking
Answer: A Explanation: Occlusion Culling removes hidden objects from rendering calculations. Question 55. Which shader type is most appropriate for a UI element that needs to be transparent and interact with the UI canvas? A) Unlit/Transparent B) Standard (Opaque) C) Legacy/Diffuse D) Sprite/Default Answer: A Explanation: Unlit/Transparent respects alpha blending without lighting, ideal for UI. Question 56. Which C# keyword allows you to define a method that can be called without creating an instance of its class? A) virtual B) static C) abstract D) sealed Answer: B Explanation: static methods belong to the type itself and can be invoked directly. Question 57. In Unity, which component is required to make a UI element respond to drag gestures? A) EventTrigger B) Rigidbody2D C) CanvasGroup