Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Computer Graphics (rasterisation, ray tracing, WebGPU) Module 2

The maths toolkit: vectors, matrices and precision interview questions

Interview questions on “The maths toolkit: vectors, matrices and precision”: warm-ups, then what each harder question tests and how a good answer starts.

9 questions: 3 warm-ups and 6 with model answers · Levels: Fresher to senior

Warm-up questions

Short questions with short answers, each answered in full.

  1. Fresher to mid

    What do the dot product and the cross product of two vectors tell you?

    Answered in the lesson Vectors, points, dot and cross products

  2. Fresher to mid

    Why do graphics programs use 4 × 4 matrices for 3D points?

    Answered in the lesson Matrices and homogeneous coordinates

  3. Fresher to mid

    In JavaScript, 0.1 + 0.2 === 0.3 is false. Why, and how should a test compare floating-point results?

    Answered in the lesson Floating point, precision and robust geometry

Questions with model answers

What each question tests, the first step of a good answer and the follow-ups to expect.

  1. Mid to senior

    A level designer mirrors a model by scaling it by −1 along x. In the game the mirrored copy looks inside out: its inside faces show and its lighting looks wrong. Explain both effects and fix them without editing the mesh.

    What it tests
    How a mirror reverses winding and handedness, how culling and normals depend on them, and a fix in the pipeline rather than in the asset.
    First step
    Compute what the transform does to orientation: the scale (−1, 1, 1) has a determinant of −1, so it mirrors. A mirror reverses the order in which every triangle's corners appear on screen, so front faces now wind the other way and back-face culling removes them, leaving the inside faces visible.
    Follow-ups

    From the lesson Vectors, points, dot and cross products

    Model answer, Pro. Model answers open with any pass; prices are in the notice on this page.

    Opening the model answers with your pass…

    Model answers open with any MySmartCoPilot pass.

    • Pro pass · 1 week₹79$2.99
    • 30 days₹179$5.99
    • 1 year₹1,699$45

    One payment; a pass never renews. The price shown is the total you pay: no fees or charges are added at checkout.

    It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  2. Fresher to mid

    After a scanned mesh is imported, a few pixels flicker black and one object sometimes disappears. You suspect NaN normals. How do you find the cause and fix it?

    What it tests
    Degenerate triangles, normalising a zero vector, how NaN spreads through later arithmetic, and guards in the importer and the shader.
    First step
    Look for triangles whose two edges have a cross product of length 0, three corners on one line or repeated corners: normalising their normals divides by 0 and gives NaN, and every value computed from a NaN is NaN. Count such triangles in the mesh before suspecting the shader.
    Follow-ups

    From the lesson Vectors, points, dot and cross products

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  3. Fresher to mid

    A game object placed at (10, 0, 0) should spin in place, but it swings round the world origin instead. Its matrix is built every frame as R times T, with R's angle growing. Explain what happens with numbers, fix it, and say how you would stop the bug from coming back.

    What it tests
    Reading a matrix product right to left, rotations turning about the origin, and a test that tells the two orders apart.
    First step
    Apply the product to the object's own origin, (0, 0, 0). With M = R T, T moves it to (10, 0, 0) first and R then turns that point about the world origin: at 90 degrees it is at (0, 10, 0), so the object travels a circle of radius 10. Spinning in place needs the rotation applied first: M = T R.
    Follow-ups

    From the lesson Matrices and homogeneous coordinates

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  4. Mid to senior

    After an artist stretches a round lamp to twice its width, its highlights and shading look wrong, while unstretched copies of the same mesh look right. Diagnose it with numbers and fix it in the renderer, not in the mesh.

    What it tests
    Why normals need the inverse transpose of the model matrix, how big the error is, and where the normal matrix is computed in a renderer.
    First step
    The stretch is a non-uniform scale, S(2, 1, 1). If the shader transforms normals with the model matrix itself, they tilt the wrong way: on a sphere scaled like this they are off by up to 36.87 degrees. Check what matrix the shader uses for normals; it should be the inverse transpose of the model matrix's 3 × 3 part.
    Follow-ups

    From the lesson Matrices and homogeneous coordinates

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  5. Mid to senior

    In a flight simulator, the cockpit and the wings visibly shake when the aircraft is far from the world's origin, and sit still near it. Explain the cause with numbers and fix it without changing the world's units.

    What it tests
    How float32 spacing grows with magnitude, where positions lose precision on their way to the GPU, and camera-relative rendering as the fix.
    First step
    Work out the float32 gap at the aircraft's distance. A million metres from the origin, neighbouring float32 values are 0.0625 m apart, so every vertex position the GPU receives is rounded to a grid of 6.25 cm, and as the plane moves, its vertices jump between grid points by different amounts: the model shakes.
    Follow-ups

    From the lesson Floating point, precision and robust geometry

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  6. Mid to senior

    A software rasteriser shows sparkling pixels along the shared edges of neighbouring triangles: a few pixels are drawn twice and a few are missing. Explain the cause and fix it so that it cannot happen.

    What it tests
    Edge functions evaluated in floating point, why two triangles disagree about a shared edge, and exact fixed-point edge tests with a tie rule.
    First step
    Each triangle evaluates its own edge function for the shared edge, E(a, b, p) and E(b, a, p). Exactly, one is the negative of the other; in float32 they are rounded separately, so near the edge both can come out positive (drawn twice) or both negative (a hole). Compute them exactly instead.
    Follow-ups

    From the lesson Floating point, precision and robust geometry

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes

All Computer Graphics (rasterisation, ray tracing, WebGPU) interview questions · The Computer Graphics (rasterisation, ray tracing, WebGPU) track

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.