Recently, I was interviewed in game studios at a junior graphics programmer. As a result, I learned what skills they expect from a novice programmer and what questions they can ask. In this article, I put the questions into a handy list. The point is that other novice programmers can use it to prepare before going on the first interview. But I want to make a reservation that
I do not recommend simply memorizing the answers to these questions . Topics in the list are topics that should be understood and mastered in order to solve the real problems of graphics programming. They need to understand, not to remember the answers.
Questions are divided by topic:
C ++, math, optimization and computer graphics . Obviously, these are the main topics in everyday work. C ++ is often used in real-life tasks, so it’s natural that people ask a lot of questions about the interview. In addition, a better knowledge of mathematics is required in graphics programming than in most other types of programming, so math skills are paramount. Finally, in order to achieve 60 FPS and render with high graphic accuracy, strong optimization skills are essential. Let's look at popular questions in each category.
C ++ Questions
- When should virtual destructors be used? (Interviewers are absolutely delighted with this question!)
- What is the difference between heap and stack allocations?
- What features of C ++ 11 and C ++ 14 do you use?
- What are templates used for?
- Explain the
inline
. - What is the direct and inverse order of bytes (from high to low and from low to high)?
- Explain what const-correctness is.
- What are the overhead costs of calling a virtual function?
- Probably, in some question you will be asked to perform some tricks on juggling bits with operators like
&
, /
and the like. - Probably in some question you will be asked to do something with data structures linked by pointers, like a tree. For example, draw a linked list.
- What is the size of a pointer in C ++ (that is, what
sizeof
shows for a pointer)?
As a rule, nothing is asked about the advanced functions of the language. For example, I have never been asked to perform template metaprogramming, fortunately.
Mathematics Questions
In fact, questions in mathematics are pretty monotonous.
')
- What is a dot product?
- What is a vector product?
- Why use quaternions instead of Euler angles?
- How to apply matrices to transform an object? For example, how to scale, transform and rotate an object using matrices?
- How to calculate the intersection between the ray and the plane / sphere / triangle?
- Explain the concepts of world space, object space, and camera space.
Probably, they will offer to solve some practical problems associated with the use of scalar products, vector products and quaternions.
Optimization questions
- How to apply a hierarchy of limiting volumes (or octree, or something like that) to speed up the ray tracer?
- Tell us about the cache (L1 caches, L2 caches, and so on).
- What is data design ?
- Explain how to optimize clipping visibility using multithreading and SIMD (for example, see the post on Andreas Asplund's blog).
- Do you have experience using GPU performance profiling tools?
It looks like gaming studios suggest that you should have experience profiling and optimizing code with tools like NVIDIA Nsight, so familiarize yourself with them.
Here is another good book on computer architecture, including cache memory.
Computer Graphics Questions
- What smoothing methods do you know (variants: MSAA, MLAA, FXAA and TXAA)?
- What are the typical elements of the rendering engine (for example, a system for processing clipping on a pyramid of visibility, rendering shadows, processing light sources with something like deferred / direct shading, a system for processing materials in the engine, etc.)?
- What methods of shadow generation do you know (there are HEAD techniques for generating shadows, for example, differential shadow maps, smoothing the threshold using an exponential function and a more recent method of moments )?
- What are the pros and cons of deferred rendering?
- Explain what is physically correct rendering?
- Can you explain how the rendering equation works?
- What is BRDF? What do they mean when they say that “BRDF saves energy”?
- What is the impact on the performance of branching in the shader (hint: read about the concept of warps in the GPU architecture)?
- What are the advantages of the new APIs, such as Vulkan and DirectX 12, compared to the old OpenGL and DirectX 11 (hint: the main thing is reduced load on the driver)?
- What is the latest scientific article on the chart you read, can you explain it (this is a fairly common question)?
- Describe the entire graphics pipeline (probably the answer will be quite long. You will tell about the vertex shader and fragment shader, perspective perspective interpolation, Z-buffer, double buffer buffering, alpha mixing, transformation matrices, uniform coordinates, reflection models in the fragment shader, and so on).
The latter question is especially common during interviews. If you are not quite sure about all parts of the pipeline, then I advise you to write a small software rasterizer. Such an exercise provides a deep understanding of the pipeline, since the creation of a software rasterizer is in many ways similar to the implementation of a graphics pipeline from scratch.
Many of the above are warm-up questions. After them, deeper questions will follow (I will not disclose them, so as not to expose the company). Nevertheless, the above list of questions gives a good understanding of what knowledge the employer expects from a novice programmer.
Some of you are still learning and choosing subjects of the curriculum for working in computer graphics. My advice is to focus primarily on high-performance computing and applied mathematics. From programming subjects, try to master multi-threading, computer architecture and GPGPU, as well as other topics related to high-performance computing. Of the mathematics courses, linear algebra, multidimensional calculus (I think, in the USA this course is called Calculus III), probability theory, numerical optimization, differential equations and computational geometry. First of all, focus your attention on applied mathematics, and not on more abstract mathematical topics such as topology and abstract algebra, since they are not so necessary in computer graphics.
In general, they do not expect from you that you understand all the nuances of computer graphics. The term “computer graphics” covers a wide range of topics, such as global illumination, occlusion culling, shadow generation, path tracing, fluid modeling, geometry processing, GPGPU, physically correct rendering, and so on. It would be unreasonable to expect the June to know all the nuances of these topics. But if you specify something in the resume, be prepared to respond in detail to this topic.
Thus, it is not necessary to know EVERYTHING about computer graphics. It often happens that you are asked to tell about the main projects you have worked on. Then the interviewer will ask a lot of additional questions and ask you to explain in detail the details of your project. Therefore, my advice: before the interview, select a few projects that are particularly proud of - and get ready for a detailed explanation.
In my opinion, the best way to prepare for an interview is to work in your free time on a large number of third-party projects. Demonstrating the projects you have worked on is a good way to show yourself and demonstrate that you are really passionate about this business. Finally, working on third-party projects will hone programming skills. And this, in turn, will greatly help answer all the questions that I have listed in this article.