Get into GameDev:
cheat-codes for gamedev interviews
━ Additional Misc Coding Topics ━
Introduction
Space-Time Complexity
Space-Time complexity is a whole topic of questions that test a candidate's ability to evaluate an algorithms approximated runtime duration and runtime memory footprint by code inspection. It's an important skill and fairly universal in software engineering. The main thing is that you should memorize the following bucketed relationships and then be able to identify which approximate bucket corresponds with code that you inspect.
n! > 2n > n2 >> n log n >> n > log n >
Adbul Bari, the so-called "giga chad of white board problems", has a good fast video on the subject, it's a great watch: Youtube Link. This video is actually the start of a series you may enjoy.
File IO
Some interviews will require you to be familiar with file IO. The following code snippet may be useful for you to know. This code demonstrates how to read in a file and parse the first unit of data into a local variable.
#include <fstream>
std::ifstream inputStream("filename.txt", std::ios_base::binary);
uint32_t firstValue = 0;
inputStream.read( ( char * ) &firstValue , sizeof( uint32_t ) );
#include <fstream>
std::ifstream inputStream("filename.txt", std::ios_base::binary);
uint32_t firstValue = 0;
inputStream.read( ( char * ) &firstValue , sizeof( uint32_t ) );
If You're Stuck
If you ever feel stuck on an interview question it is important to remain calm. We're going to try and ask some clarifying questions to first determine if we can re-contextualize into our knowledge space.
- I'm not familiar with that term, I think it may just be that I have not heard it described or pronounced in that manner, cold you please rephrase the question?
- I haven't directly approached that specific topic in my work thus far, but I think I may be able to answer the question. Could you contextualize the problem in an example for me?
- I'm not sure how I would start on such an abstract problem, could you provide a grounded starting point for me to work off of?
- I haven't worked with that specifically. I'm familiar with X which I think could be applicable to the question you asked me, but I think X is only relevant to the context of Y. Could you explain to me a bit more about how the system you are describing works?
- I think that in pursuit of approaching this problem I would first have to refresh my knowledge base with respect to X technology. Could you please provide me with more information about X technology that might be useful for this problem?
- That's not something I've worked with before. I think I would need to do some research to provide you with a satisfactory answer. Could you provide me the solution you were looking for? I definitely want to follow up and self-study this when I get home tonight.