Common math questions that come up in game dev interviews. These fundamentals apply across all engines.
Vectors
How to find the direction vector from point A to point B?
Vector3 direction = (pointB - pointA).normalized;When should you normalize a vector?
When you only care about direction, not magnitude. Movement direction, aim direction, surface normals. Don’t normalize when magnitude matters (force application, distance checks).
What is the dot product? Examples in games?
Returns how much two vectors point in the same direction. Range: -1 (opposite) to 1 (same direction). Use for: field of view checks, lighting calculations, determining if target is in front or behind.
float dot = Vector3.Dot(forward, toTarget);
bool inFront = dot > 0;
bool inFOV = dot > 0.5f; // ~60° coneWhat is the cross product? Examples in games?
Returns a vector perpendicular to two input vectors. Use for: finding surface normals, determining left/right of a direction, calculating torque.
Vector3 normal = Vector3.Cross(edge1, edge2).normalized;
float side = Vector3.Cross(forward, toTarget).y; // positive = right, negative = leftHow to find the angle between two vectors?
float angle = Vector3.Angle(vectorA, vectorB);
// Or using dot product:
float angle = Mathf.Acos(Vector3.Dot(a.normalized, b.normalized)) * Mathf.Rad2Deg;Collision Detection
How to determine if two circles are intersecting?
float distance = Vector2.Distance(circleA.center, circleB.center);
bool intersecting = distance < (circleA.radius + circleB.radius);For better performance, compare squared distances:
float sqrDistance = (circleA.center - circleB.center).sqrMagnitude;
float combinedRadius = circleA.radius + circleB.radius;
bool intersecting = sqrDistance < (combinedRadius * combinedRadius);How to check if a point is inside a rectangle (AABB)?
bool inside = point.x >= rect.min.x && point.x <= rect.max.x &&
point.y >= rect.min.y && point.y <= rect.max.y;How to check if two AABBs are intersecting?
bool intersecting = a.min.x <= b.max.x && a.max.x >= b.min.x &&
a.min.y <= b.max.y && a.max.y >= b.min.y;See AABB for more details.
Interpolation
What is Lerp and when to use it?
Linear interpolation between two values. Lerp(a, b, t) returns a when t=0, b when t=1, and blends between for values in between. Use for smooth movement, color fading, UI animations.
// Move 10% closer each frame (easing)
transform.position = Vector3.Lerp(transform.position, target, 0.1f);
// Move at constant speed over time
transform.position = Vector3.Lerp(start, end, elapsedTime / duration);What’s the difference between Lerp and Slerp?
Lerp interpolates linearly (straight line). Slerp interpolates along a sphere’s surface (arc). Use Slerp for rotations to avoid weird warping at extreme angles.
Trigonometry
How to move in a circle?
float x = Mathf.Cos(angle) * radius;
float y = Mathf.Sin(angle) * radius;How to get the angle from a direction vector?
float angle = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg;The magic: These math concepts are engine-agnostic and show up everywhere in game dev. Understanding the geometry behind them helps you solve problems the docs don’t cover.