Unity Coding Interview Questions
27 Unity coding interview problems with full optimal solutions — 17 easy, 9 medium, 1 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Unity interviewer values, and a FAQ section.
Showing 17 problems of 27
- #16easyfoundational
16. Contains Duplicate
Detect repeated values in an array — the same deduplication check Unity's asset import pipeline runs when the editor scans a folder for duplicate mesh GUIDs before loading a scene.
- #17easyfoundational
17. Valid Anagram
Check whether two strings are rearrangements of the same characters — the same frequency-table logic Unity uses to validate shader tag consistency between two material property blocks at runtime.
- #1easyfoundational
1. Two Sum
Find two array indices whose values sum to a target. Unity uses this to probe hash-map fluency for runtime entity lookups.
- #2easyfoundational
2. Valid Parentheses
Check whether brackets are balanced using a stack. Unity uses this to test scene-graph traversal intuition.
- #3easyfoundational
3. Merge Two Sorted Lists
Merge two sorted linked lists into one sorted list. Unity uses this to probe pointer hygiene used in entity update queues.
- #4easyfoundational
4. Remove Duplicates from Sorted Array
Remove duplicates from a sorted array in place. Unity uses this to probe in-place mutation needed for asset-pipeline buffers.
- #5easyfoundational
5. Remove Element
Remove all occurrences of a value from an array in place. Unity uses this to test entity-list compaction patterns.
- #6easyfoundational
6. Search Insert Position
Find the index where a target should be inserted to keep a sorted array sorted. Unity uses this for ordered scene-graph child insertion.
- #7easyfoundational
7. Plus One
Increment a large integer stored as a digit array. Unity uses this to test carry-handling on packed counters in physics state.
- #8easyfoundational
8. Merge Sorted Array
Merge two sorted arrays in place from the back. Unity uses this for asset-bundle splice patterns at load time.
- #9easyfoundational
9. Binary Tree Inorder Traversal
Return inorder traversal of a binary tree. Unity uses this to test scene-graph walks that have to remain allocation-free.
- #10easyfoundational
10. Same Tree
Decide if two binary trees are structurally identical. Unity uses this for scene-graph diffing during incremental rebuilds.
- #11easyfoundational
11. Symmetric Tree
Decide if a tree is a mirror of itself. Unity uses this to test mirrored-rig validation in animation pipelines.
- #12easyfoundational
12. Maximum Depth of Binary Tree
Compute the maximum depth of a binary tree. Unity uses this to bound LOD-tree depth checks during streaming.
- #13easyfoundational
13. Balanced Binary Tree
Decide if a tree is height-balanced. Unity uses this for BVH-balance checks during physics broadphase rebuilds.
- #14easyfoundational
14. Minimum Depth of Binary Tree
Find the shortest root-to-leaf path. Unity uses this in BVH descent to find the nearest collision candidate.
- #15easyfoundational
15. Pascal's Triangle
Generate the first numRows of Pascal's triangle. Unity uses this to test row-allocation discipline in batched mesh buffers.