Adaface Sample Unity Questions
Here are some sample Unity questions from our premium questions library (10273 non-googleable questions).
Skills
Aptitude & Soft Skills
Logical Reasoning Abstract Reasoning English Reading Comprehension Spatial Reasoning Verbal Reasoning Diagrammatic Reasoning Critical Thinking Data Interpretation Situational Judgement Attention to Detail Numerical Reasoning Aptitude Quantitative Reasoning Inductive Reasoning Deductive Reasoning Error Checking English Speaking Pronunciation
Product & Design
Visualization & BI Tools
Programming Languages
Frontend Development
Backend Development
Data Science & AI
Data Engineering & Databases
Cloud & DevOps
Testing & QA
Accounting & Finance
Microsoft & Power Platform
CRM & ERP Platforms
Cybersecurity & Networking
Marketing & Growth
Oracle Technologies
Other Tools & Technologies
🧐 Question | |||||
---|---|---|---|---|---|
Medium SO Application ScriptableObjects Data Management Performance Optimization | Solve | ||||
Consider the following Unity3D scenario where you are tasked with optimizing a game's configuration settings using Scriptable Objects for data-driven design. Examine the given ScriptableObject script and answer the question: How can you ensure that data from multiple Scriptable Objects are properly aggregated and utilized at runtime without creating unnecessary instances? using UnityEngine; [CreateAssetMenu(fileName = "GameConfig", menuName = "Configurations/GameConfig")] public class GameConfig : ScriptableObject { public string configName; public int maxEnemies; public float enemySpawnRate; public void DisplayConfig() { Debug.Log($"Config: {configName}, Max Enemies: {maxEnemies}, Spawn Rate: {enemySpawnRate}"); } } Options: A: Use static variables in ScriptableObject for data access B: Instantiate ScriptableObjects on script load C: Reference ScriptableObjects in MonoBehaviour scripts using Inspector D: Load all ScriptableObjects at runtime using Resources.Load E: Use a Singleton to manage ScriptableObject instances F: Merge data manually during runtime in a central manager | |||||
Medium Prefab Instantiation Prefabs Instantiation Scripting | Solve | ||||
You are tasked with creating a system that spawns enemies in Unity3D using prefabs. The prefab `EnemyPrefab` has a script attached, `EnemyBehavior`, which contains a public integer field `damage`. The goal is to instantiate this prefab at random positions within a specified area. Consider the following code snippet: using System.Collections; using UnityEngine; public class EnemySpawner : MonoBehaviour { public GameObject enemyPrefab; public Vector3 areaSize; public int enemyCount; void Start() { for (int i = 0; i < enemyCount; i++) { InstantiateEnemy(); } } void InstantiateEnemy() { Vector3 randomPosition = new Vector3( Random.Range(-areaSize.x / 2, areaSize.x / 2), 0, Random.Range(-areaSize.z / 2, areaSize.z / 2) ); GameObject enemy = Instantiate(enemyPrefab, randomPosition, Quaternion.identity); enemy.GetComponent<EnemyBehavior>().damage = Random.Range(10, 50); } } Consider the above code snippet and choose the correct statement about how the prefabs will be instantiated and configured. A: Enemies will spawn at fixed intervals B: The enemies' y-coordinate will be random C: Each enemy will most likely have a unique damage value D: Prefabs will need to be set manually in the inspector E: Quaternions are not used for rotation in instantiation | |||||
Medium Synchronization and Latency Synchronization Latency Client-Side Prediction | Solve | ||||
In a multiplayer Unity3D game using the UNet HLAPI, you want to implement a client-side prediction feature to reduce perceived latency. Consider the following pseudo code that represents a movement synchronization system between client and server: struct PlayerState { Vector3 position; Quaternion rotation; float timestamp; } class Player : NetworkBehaviour { Queue<PlayerState> _stateBuffer; Vector3 _lastKnownPosition; Quaternion _lastKnownRotation; void Update() { if (isLocalPlayer) { CmdSendInputToServer(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical")); } else { InterpolatePlayerState(); } } [Command] void CmdSendInputToServer(float h, float v) { Vector3 movement = new Vector3(h, 0, v); PlayerState state = new PlayerState { position = transform.position + movement * Time.deltaTime, rotation = transform.rotation, timestamp = Time.time }; RpcSyncStateWithClients(state); } [ClientRpc] void RpcSyncStateWithClients(PlayerState state) { _stateBuffer.Enqueue(state); } void InterpolatePlayerState() { // Detail on interpolation logic } } Which of the following best describes the function and interaction of this synchronization mechanism in handling client prediction and latency? A: The predictions occur server-side and all clients receive delayed updates leading to smooth rendering. B: Clients interpolate state using immediate server responses improving local movement fluidity. C: Server commands constrain client input ensuring prediction accuracy at the cost of responsiveness. D: Clients run prediction logic locally and periodically reconcile with server states to reduce perceived latency. E: Rotation synchronization suffices for latency compensation eliminating prediction necessity. F: State buffering on clients introduces latency in movement handling but helps in network event logging. |
🧐 Question | 🔧 Skill | ||||
---|---|---|---|---|---|
Medium SO Application ScriptableObjects Data Management Performance Optimization | 2 mins Unity | Solve | |||
Consider the following Unity3D scenario where you are tasked with optimizing a game's configuration settings using Scriptable Objects for data-driven design. Examine the given ScriptableObject script and answer the question: How can you ensure that data from multiple Scriptable Objects are properly aggregated and utilized at runtime without creating unnecessary instances? using UnityEngine; [CreateAssetMenu(fileName = "GameConfig", menuName = "Configurations/GameConfig")] public class GameConfig : ScriptableObject { public string configName; public int maxEnemies; public float enemySpawnRate; public void DisplayConfig() { Debug.Log($"Config: {configName}, Max Enemies: {maxEnemies}, Spawn Rate: {enemySpawnRate}"); } } Options: A: Use static variables in ScriptableObject for data access B: Instantiate ScriptableObjects on script load C: Reference ScriptableObjects in MonoBehaviour scripts using Inspector D: Load all ScriptableObjects at runtime using Resources.Load E: Use a Singleton to manage ScriptableObject instances F: Merge data manually during runtime in a central manager | |||||
Medium Prefab Instantiation Prefabs Instantiation Scripting | 2 mins Unity | Solve | |||
You are tasked with creating a system that spawns enemies in Unity3D using prefabs. The prefab `EnemyPrefab` has a script attached, `EnemyBehavior`, which contains a public integer field `damage`. The goal is to instantiate this prefab at random positions within a specified area. Consider the following code snippet: using System.Collections; using UnityEngine; public class EnemySpawner : MonoBehaviour { public GameObject enemyPrefab; public Vector3 areaSize; public int enemyCount; void Start() { for (int i = 0; i < enemyCount; i++) { InstantiateEnemy(); } } void InstantiateEnemy() { Vector3 randomPosition = new Vector3( Random.Range(-areaSize.x / 2, areaSize.x / 2), 0, Random.Range(-areaSize.z / 2, areaSize.z / 2) ); GameObject enemy = Instantiate(enemyPrefab, randomPosition, Quaternion.identity); enemy.GetComponent<EnemyBehavior>().damage = Random.Range(10, 50); } } Consider the above code snippet and choose the correct statement about how the prefabs will be instantiated and configured. A: Enemies will spawn at fixed intervals B: The enemies' y-coordinate will be random C: Each enemy will most likely have a unique damage value D: Prefabs will need to be set manually in the inspector E: Quaternions are not used for rotation in instantiation | |||||
Medium Synchronization and Latency Synchronization Latency Client-Side Prediction | 2 mins Unity | Solve | |||
In a multiplayer Unity3D game using the UNet HLAPI, you want to implement a client-side prediction feature to reduce perceived latency. Consider the following pseudo code that represents a movement synchronization system between client and server: struct PlayerState { Vector3 position; Quaternion rotation; float timestamp; } class Player : NetworkBehaviour { Queue<PlayerState> _stateBuffer; Vector3 _lastKnownPosition; Quaternion _lastKnownRotation; void Update() { if (isLocalPlayer) { CmdSendInputToServer(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical")); } else { InterpolatePlayerState(); } } [Command] void CmdSendInputToServer(float h, float v) { Vector3 movement = new Vector3(h, 0, v); PlayerState state = new PlayerState { position = transform.position + movement * Time.deltaTime, rotation = transform.rotation, timestamp = Time.time }; RpcSyncStateWithClients(state); } [ClientRpc] void RpcSyncStateWithClients(PlayerState state) { _stateBuffer.Enqueue(state); } void InterpolatePlayerState() { // Detail on interpolation logic } } Which of the following best describes the function and interaction of this synchronization mechanism in handling client prediction and latency? A: The predictions occur server-side and all clients receive delayed updates leading to smooth rendering. B: Clients interpolate state using immediate server responses improving local movement fluidity. C: Server commands constrain client input ensuring prediction accuracy at the cost of responsiveness. D: Clients run prediction logic locally and periodically reconcile with server states to reduce perceived latency. E: Rotation synchronization suffices for latency compensation eliminating prediction necessity. F: State buffering on clients introduces latency in movement handling but helps in network event logging. |
🧐 Question | 🔧 Skill | 💪 Difficulty | ⌛ Time | ||
---|---|---|---|---|---|
SO Application ScriptableObjects Data Management Performance Optimization | Unity | Medium | 2 mins | Solve | |
Consider the following Unity3D scenario where you are tasked with optimizing a game's configuration settings using Scriptable Objects for data-driven design. Examine the given ScriptableObject script and answer the question: How can you ensure that data from multiple Scriptable Objects are properly aggregated and utilized at runtime without creating unnecessary instances? using UnityEngine; [CreateAssetMenu(fileName = "GameConfig", menuName = "Configurations/GameConfig")] public class GameConfig : ScriptableObject { public string configName; public int maxEnemies; public float enemySpawnRate; public void DisplayConfig() { Debug.Log($"Config: {configName}, Max Enemies: {maxEnemies}, Spawn Rate: {enemySpawnRate}"); } } Options: A: Use static variables in ScriptableObject for data access B: Instantiate ScriptableObjects on script load C: Reference ScriptableObjects in MonoBehaviour scripts using Inspector D: Load all ScriptableObjects at runtime using Resources.Load E: Use a Singleton to manage ScriptableObject instances F: Merge data manually during runtime in a central manager | |||||
Prefab Instantiation Prefabs Instantiation Scripting | Unity | Medium | 2 mins | Solve | |
You are tasked with creating a system that spawns enemies in Unity3D using prefabs. The prefab `EnemyPrefab` has a script attached, `EnemyBehavior`, which contains a public integer field `damage`. The goal is to instantiate this prefab at random positions within a specified area. Consider the following code snippet: using System.Collections; using UnityEngine; public class EnemySpawner : MonoBehaviour { public GameObject enemyPrefab; public Vector3 areaSize; public int enemyCount; void Start() { for (int i = 0; i < enemyCount; i++) { InstantiateEnemy(); } } void InstantiateEnemy() { Vector3 randomPosition = new Vector3( Random.Range(-areaSize.x / 2, areaSize.x / 2), 0, Random.Range(-areaSize.z / 2, areaSize.z / 2) ); GameObject enemy = Instantiate(enemyPrefab, randomPosition, Quaternion.identity); enemy.GetComponent<EnemyBehavior>().damage = Random.Range(10, 50); } } Consider the above code snippet and choose the correct statement about how the prefabs will be instantiated and configured. A: Enemies will spawn at fixed intervals B: The enemies' y-coordinate will be random C: Each enemy will most likely have a unique damage value D: Prefabs will need to be set manually in the inspector E: Quaternions are not used for rotation in instantiation | |||||
Synchronization and Latency Synchronization Latency Client-Side Prediction | Unity | Medium | 2 mins | Solve | |
In a multiplayer Unity3D game using the UNet HLAPI, you want to implement a client-side prediction feature to reduce perceived latency. Consider the following pseudo code that represents a movement synchronization system between client and server: struct PlayerState { Vector3 position; Quaternion rotation; float timestamp; } class Player : NetworkBehaviour { Queue<PlayerState> _stateBuffer; Vector3 _lastKnownPosition; Quaternion _lastKnownRotation; void Update() { if (isLocalPlayer) { CmdSendInputToServer(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical")); } else { InterpolatePlayerState(); } } [Command] void CmdSendInputToServer(float h, float v) { Vector3 movement = new Vector3(h, 0, v); PlayerState state = new PlayerState { position = transform.position + movement * Time.deltaTime, rotation = transform.rotation, timestamp = Time.time }; RpcSyncStateWithClients(state); } [ClientRpc] void RpcSyncStateWithClients(PlayerState state) { _stateBuffer.Enqueue(state); } void InterpolatePlayerState() { // Detail on interpolation logic } } Which of the following best describes the function and interaction of this synchronization mechanism in handling client prediction and latency? A: The predictions occur server-side and all clients receive delayed updates leading to smooth rendering. B: Clients interpolate state using immediate server responses improving local movement fluidity. C: Server commands constrain client input ensuring prediction accuracy at the cost of responsiveness. D: Clients run prediction logic locally and periodically reconcile with server states to reduce perceived latency. E: Rotation synchronization suffices for latency compensation eliminating prediction necessity. F: State buffering on clients introduces latency in movement handling but helps in network event logging. |
Trusted by recruitment teams in enterprises globally






















We evaluated several of their competitors and found Adaface to be the most compelling. Great library of questions that are designed to test for fit rather than memorization of algorithms.
Swayam Narain, CTO, Affable




Join 1200+ companies in 80+ countries.
Try the most candidate friendly skills assessment tool today.

Ready to streamline your recruitment efforts with Adaface?
Ready to streamline your recruitment efforts with Adaface?
Chat with us
Product
Usecases
© 2025 Adaface Pte. Ltd.