Unity 3D Developer Interview Questions & Answers
Download PDF

Unity 3D Developer related Frequently Asked Questions by expert members with job experience as Unity 3D Developer. These questions and answers will help you strengthen your technical skills, prepare for the new job interview and quickly revise your concepts

35 Unity 3D Developer Questions and Answers:

Unity 3D Developer Interview Questions Table of Contents:

Unity 3D Developer Job Interview Questions and Answers
Unity 3D Developer Job Interview Questions and Answers

1 :: Explain what Is Unity 3d?

Unity 3D is a powerful cross-platform and fully integrated development engine which gives out-of-box functionality to create games and other interactive 3D content.

2 :: What is number of Unverified Transactions?

The total number of IAP transactions, whether or not they have been verified.

IAP transactions include Unity IAP purchases and purchases reported using the Analytics.Transaction() function.

3 :: Please explain why Vectors Should Be Normalized When Used To Move An Object?

Normalization makes the vector unit length. It means, for instance, that if you want to move with speed 20.0, multiplying speed * vector will result in a precise 20.0 units per step. If the vector had a random length, the step would be different than 20.0 units.

4 :: What is sessions per User?

The average number of sessions per person playing on a given day.
Also known as Average Number of Sessions per DAU.

5 :: Tell us what A Vertex Shader Is, And What A Pixel Shader Is?

Vertex shader is a script that runs for each vertex of the mesh, allowing the developer to apply transformation matrixes, and other operations, in order to control where this vertex is in the 3D space, and how it will be projected on the screen.

Pixel shader is a script that runs for each fragment (pixel candidate to be rendered) after three vertexes are processed in a mesh's triangle. The developer can use information like the UV / TextureCoords and sample textures in order to control the final color that will be rendered on screen.

6 :: What is MAU (Monthly Active Users)?

The number of players who started a session within the last 30 days.

7 :: Tell me the Pros And Cons Of Unity 3d?

Pros:
► It uses JavaScript and C# language for scripting
► Unity provides an Asset store where you can buy or find stuff, that you want to use in your games
► You can customize your own shaders and change the way how Unity renders the game
► It is great platform for making games for mobile devices like iOS, Android and Web (HTML5)

Cons:
► Compared to Unreal Engine it has got low graphics quality
► Interface not user-friendly and it is hard to learn especially for beginners
► It requires good programming knowledge as such most of the stuff runs on Scripts.

8 :: What is total Verified Revenue?

Revenue from Unity Ads and verified IAP transactions. IAP verification is currently supported by the Apple App Store and the Google Play Store.

9 :: Tell us some Best Practices For Unity 3d?

► Cache component references: Always cache reference to components you need to use your scripts

► Memory Allocation: Instead of instantiating the new object on the fly, always consider creating and using object pools. It will help to less memory fragmentation and make the garbage collector work less

► Layers and collision matrix: For each new layer, a new column and row are added on the collision matrix. This matrix is responsible for defining interactions between layers

► Raycasts: It enables to fire a ray on a certain direction with a certain length and let you know if it hit something

► Physics 2D 3D: Choose physics engine that suits your game

► Rigidbody: It is an essential component when adding physical interactions between objects

► Fixed Timestep: Fixed timestep value directly impacts the fixedupdate() and physics update rate.

10 :: Please explain why Time.deltatime Should Be Used To Make Things That Depend On Time Operate Correctly?

Real time applications, such as games, have a variable FPS. They sometimes run at 60FPS, or when suffering slowdowns, they will run on 40FPS or less.

If you want to change a value from A to B in 1.0 seconds you can't simply increase A by B-A between two frames because frames can run fast or slow, so one frame can have different durations.

The way to correct this is to measure the time taken from frame X to X+1 and increment A, leveraging this change with the frame duration deltaTime by doing A += (B-A) * DeltaTime.

When the accumulated DeltaTime reaches 1.0 second, A will have assumed B value.

11 :: Tell me some Key Features Of Unity3d Ue4 ( Unreal Engine 4)?

UE4:
► Game logic is written in C++ or blueprint editor
► Base scene object- Actor
► Input Events- Component UInputComponent of Actor class
► Main classes and function of UE4 includes int32,int24, Fstring, Ftransform, FQuat, FRotator, Actor and TArray
► To create a new instance of a specified class and to point towards the newly created Actor. UWorld::SpawnActor() may be used
► UI of Unreal Engine 4 is more flexible and less prone to crashes
► It does not support systems like X-box 360 or PS3, it requires AMD Radeon HD card to function properly
► Less expensive compare to Unity3D
► To use UE4 you don't need programming language knowledge

Unity3D:
► Game logic is written using the Mono environment
► Base scene object- GameObject
► Input events- Class Input
► Main classes and function include int,string,quaternion,transform, rotation, gameobject, Array
► To make a copy of an object you can use the function Instantiate()
► The asset store of this tool is much better stacked than UE4
► It supports wide range of gaming consoles like X-box and PS4, as well as their predecessors
► Unity3D has free version which lacks few functionality while pro version is bit expensive in compare to UE4
► It requires programming language knowledge.

12 :: What is DAU (Daily Active Users)?

The number of different players who started a session on a given day. The Unity Analytics system anchors its days on Coordinated Universal Time (UTC), so the DAU figure counts players between 0:00 UTC and 24:00 UTC, no matter which timezone they are located in. A new session is counted when a player launches your game or brings a suspended game to the foreground after 30 minutes of inactivity.

DAU includes both new and returning players.

13 :: Tell me can Threads Be Used To Modify A Texture On Runtime?
Can Threads Be Used To Move A Gameobject On The Scene?
Consider The Snippet Below:
Class Randomgenerator : Monobehaviour
{
Public Float[] Randomlist;

Void Start()
{
Randomlist = New Float[1000000];

}

Void Generate()
{
System.random Rnd = New System.random();
For(int I=0;i }
}
Improve This Code Using Threads, So The 1000000 Random Number Generation Runs Without Spoiling Performance.?

No. Texture and Meshes are examples of elements stored in GPU memory and Unity doesn't allow other threads, besides the main one, to make modifications on these kinds of data.

No. Fetching the Transform reference isn't thread safe in Unity.

When using threads, we must avoid using native Unity structures like the Mathf and Random classes:

class RandomGenerator : MonoBehaviour
{
public float[] randomList;
void Start()
{
randomList = new float[1000000];
Thread t = new Thread(delegate()
{
while(true)
{
Generate();
Thread.Sleep(16); // trigger the loop to run roughly every 60th of a second
}
});
t.Start();
}
void Generate()
{
System.Random rnd = new System.Random();
for(int i=0;i<randomList.Length;i++) randomList[i] = (float)rnd.NextDouble();
}
}

14 :: Do you know what Is Fixed Timestep In Unity3d? Why Does Fixed Timestep Setting Affect Game Speed?

Fixed Timestep feature helps to set the system updates at fixed time interval. A queue like mechanism will manage all real-time events that are accumulated between time epochs. If frame-rate drops below some threshold limit set for fixed timestep, then it can affect the game speed.

15 :: Explain me important Components Of Unity 3d?

Some important Unity 3D components include:

► Toolbar: It features several important manipulation tools for the scene and game windows.

► Scene View: It is a fully rendered 3 D preview of the currently open scene is displayed and enables you to add, edit and remove GameObjects

► Hierarchy: It displays a list of every GameObject within the current scene view

► Project Window: In complex games, project window searches for specific game assets as needed. It explores the assets directory for all textures, scripts, models and prefabs used within the project

► Game View: In unity you can view your game and at the same time make changes to your game while you are playing in real time.

16 :: Explain me The Following Code Snippet Below:
Class Mover : Monobehaviour
{
Vector3 Target;
Float Speed;
Void Update()
{

}
}
Finish This Code So The Gameobject Containing This Script Moves With Constant Speed Towards Target, And Stop Moving Once It Reaches 1.0, Or Less, Units Of Distance?

class Mover : MonoBehaviour
{

Vector3 target;
float speed;

void Update()
{
float distance = Vector3.Distance(target,transform.position);
// will only move while the distance is bigger than 1.0 units
if(distance > 1.0f)
{
Vector3 dir = target - transform.position;
dir.Normalize(); // normalization is obligatory
transform.position += dir * speed * Time.deltaTime; // using deltaTime and speed is obligatory
}
}
}

17 :: Tell me in A Few Words, What Roles The Inspector, Project And Hierarchy Panels In The Unity Editor Have. Which Is Responsible For Referencing The Content That Will Be Included In The Build Process?

The inspector panel allows users to modify numeric values (such as position, rotation and scale), drag and drop references of scene objects (like Prefabs, Materials and Game Objects), and others. Also it can show a custom-made UI, created by the user, by using Editor scripts.

The project panel contains files from the file system of the assets folder in the project's root folder. It shows all the available scripts, textures, materials and shaders available for use in the project.

The hierarchy panel shows the current scene structure, with its GameObjects and its children. It also helps users organize them by name and order relative to the GameObject's siblings. Order dependent features, such as UI, make use of this categorization.

The panel responsible for referencing content in the build process is the hierarchy panel. The panel contains references to the objects that exist, or will exist, when the application is executed. When building the project, Unity searches for them in the project panel, and adds them to the bundle.

18 :: Can you please explain Two Gameobjects, Each With Only An Spherecollider, Both Set As Trigger And Raise Ontrigger Events?

No. Collision events between two objects can only be raised when one of them has a RigidBody attached to it. This is a common error when implementing applications that use "physics."

19 :: Basic Unity 3D Developer Job Interview Questions:

☛ What is the best game that you made with Unity?
☛ Which app on the app store did you make most money from?
☛ How did you create asset bundles for your game?
☛ What do you think about the threading model in Unity?
☛ When would you use plugins?
☛ How can you call c# from Javascript, and vice versa?
☛ How active are you on the forum and answers sites? (What's your username?)
☛ What editor scripting have you done, and how did that go?
☛ What is one change/improvement you'd make to Unity?
☛ What source code revision software would you recommend using?

20 :: Professional Unity 3D Developer Job Interview Questions:

☛ Difference between Update,Fixed Update and Late Update.
☛ What is Prefabs in Unity 3D?
☛ What is the use of AssetBundle in Unity?
☛ What is difference between Resources and StreamingAssets Folder.
☛ What is Batching and what is the use of Batching?
☛ Difference between Destroy and DestroyImmediate unity function
☛ Difference between Start and Awake Unity Events
☛ What is the use of deltatime?
☛ Is this possible to collide two mesh collider,if yes then How?
☛ Difference between Static and Dynamic Batching.
☛ What is the use of Occlusion Culling?
☛ How can you call C# from Javascript, and vice versa?

21 :: Difficult Unity 3D Developer Job Interview Questions:

☛ What is Coroutine,is it running on new thread?
☛ Difference between Stack and Heap.
☛ What do you mean by Inheritance ? Explain with example.
☛ What do you mean by Polymorohism? Explain with example.
☛ What is overriding ?
☛ What is overloading ?
☛ Difference between overriding and overloading.
☛ What is the use of Virtual keyword ?
☛ Difference between Static Class and Singleton.
☛ What is Abstract Class ?
☛ Difference between Abstract Class and interface.
☛ What is Serialization and De-Serialization ?
☛ Does C# support multiple inheritance ?
☛ What do you mean by Generic Function or Generic Class ?

22 :: Tell me the Issue With The Code Below And Provide An Alternative Implementation That Would Correct The Problem.
Using Unityengine;
Using System.collections;
Public Class Test : Monobehaviour {
Void Start () {
Transform.position.x = 10;
}
}?

The issue is that you can't modify the position from a transform directly. This is because the position is actually a property (not a field). Therefore, when a getter is called, it invokes a method which returns a Vector3 copy which it places into the stack.

So basically what you are doing in the code above is assigning a member of the struct a value that is in the stack and that is later removed.

Instead, the proper solution is to replace the whole property; e.g.:

using UnityEngine;
using System.Collections;
public class TEST : MonoBehaviour {
void Start () {
Vector3 newPos = new Vector3(10, transform.position.y, transform.position.z);
transform.position = newPos;
}
}

23 :: Can you arrange The Event Functions Listed Below In The Order In Which They Will Be Invoked When An Application Is Closed:
☛ Update()
☛ Ongui()
☛ Awake()
☛ Ondisable()
☛ Start()
☛ Lateupdate()
☛ Onenable()
☛ Onapplicationquit()
☛ Ondestroy()

The correct execution order of these event functions when an application closes is as follows:

☛ Awake()
☛ OnEnable()
☛ Start()
☛ Update()
☛ LateUpdate()
☛ OnGUI()
☛ OnApplicationQuit()
☛ OnDisable()
☛ OnDestroy()

Note: You might be tempted to disagree with the placement of OnApplicationQuit() in the above list, but it is correct which can be verified by logging the order in which call occurs when your application closes.

24 :: Please explain how Do You Feel About Crunching?

At smaller studios, this is the 64 million dollar question. My advice is to be 100 percent honest. If you won't crunch, say so now. It may well put you out of the running for a job, but ultimately that's a good thing. No, really, it is! If the company works a lot of overtime and you don't want to do it, then taking the job is going to be punishing for everyone.

Having said that, the last thing any interviewer wants to hear is, "I won't do it" because that predicates a perceived lack of involvement and passion (not that passion should equal overtime, but the perception of refusing to do something before you're even in the circumstances could be the difference between getting a job offer and having the company pass you up).

25 :: Do you know what is the Best Game Of All Time And Why?

The most important thing here is to answer relatively quickly, and back it up. One of the fallouts of this question is age. Answering "Robotron!" to a 20-something interviewer might lead to a feeling of disconnect. But sometimes that can be good. It means you have to really explain why it's the best game of all time. Can you verbally and accurately describe a game to another person who has never played it? You'll rack up some communication points if you can.

What you shouldn't say is whatever the latest hot game is, or blatantly pick one that the company made (unless it's true and your enthusiasm is bubbling over). Be honest. Don't be too eccentric and niche, and be ready to defend your decision.
Unity 3D Developer Interview Questions and Answers
35 Unity 3D Developer Interview Questions and Answers