Two related questions for computer graphics people:

1. is it true that ray/line/whatever intersection tests are common in interviews?

2. how common are questions of this nature, where you have equations memorized?šŸ¤”

(boosts appreciated pls)

@ruba

1. yes, super common

2. they're not really about memorizing equations, more about showing you have a working grasp of 3d maths and basic algebraic operations - if you're comfortable with vectors, dot product, cross product you can likely get to the answer, interviewers are looking to hear your thought process

@im @ruba yeah, basically this. In computer graphics you are kinda expected to know what vectors and especially dot products among them are. Since like 90% of all graphics is dot products, if you squint :)

And if you *really* know what dot products are, then various intersection/distance things you can derive (slowly) out of that without having to "memorize" any of them.

@aras @im @ruba yeah. DotProduct math is a ā€œcore competencyā€. Also true for gameplay programming.

RaySphere should be trivial. More complex should be derivable in an interview context. Especially with interviewer hints.

@forrestthewoods @aras @im @ruba The knowledge (or lack thereof) of the dot product is a running joke in certain gamedev circles. It started with someone who couldn't fathom that you didn't know what it was or how to use it.

Well, I don't know the formula(s) off the top of my head, so my firm stance is that I don't "know" dot product. I just have not had the need to use it in the last few years.

@forrestthewoods @aras @im @ruba Ray-sphere intersections are not something I would be able to do. I can see how to do it geometrically in 2D, but implementing it or extending it to 3D is black magic to me.

Maybe I'm not a good graphics programmer after all?

Well, I only have an MSc in graphics programming, and I have shipped games that use dot product to compute most of the game logic, and I have written some of the fastest texture compressors there are.

@forrestthewoods @aras @im @ruba But I don't know some basic mathematical formulas that have been relatively unimportant to me during my 20 years of work.

The important thing is that you can find all the answers to these silly trivia questions with 5 minutes of googling.

@wolfpld @forrestthewoods @im @ruba oh yeah the whole interviewing process is mostly stupid, but it is what it is.

If you can *somehow* make it so that you don't have to do interviewing, that is always way better (i.e. that people would want to hire specifically you). But this advice is same level of usefulness as "if poor don't want to be poor, why don't they become rich", right.

@aras @forrestthewoods @im @ruba The interviews I keep reading about seem to be nothing more than ego trips. I have never been through anything like that.

When I interviewed people, I found that asking simple questions was enough to get a reliable feeling about the candidate.

For example, simply asking what operating systems someone has worked on is a great way to see if they have been exposed to more than one environment, and if they can handle a new set of challenges.

@aras @forrestthewoods @im @ruba Asking how someone would implement the C++11 move semantics in a data structure is an eye-opener. Some people won't be able to tell you how to do it, even if you lead them straight to the solution.

One of the code-writing questions I ask is to write a strlen implementation. It's pretty simple, but people will do things like non-const parameters, or signed return values, and that shows you something.

There is no need to do anything "hard" in an interview.