# Interview Preparation

This topic is 2257 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Can any one post some good links to C/C++ Interview questions that were asked in any of the MNC's?

##### Share on other sites
http://www.gamedev.n..._hl__interviews

Believe it or not, I recently interviewed at a major game company in Tokyo and near the end, the CEO told me to tell a joke. It was a bit random.

“Superman was flying over the city when he saw Superwoman on the roof of a building, naked in a lawn chair.
He figured with his super speed he could get in and out before she even knew what happened.
He went in, did his thing, and happily zipped off in a blink of an eye.
Superwoman leaned up and said, ‘What was that??’
The Invisible Man replied, ‘I don’t know but my ass is killing me.’”

I was hired on-the-spot.

L. Spiro

##### Share on other sites
I would have flat refused, then walked if they pushed me on it. What a bizzare request, basically "will you debase yourself for me on my whim?".

##### Share on other sites
I am sorry you think of jokes as debasing yourself. I hold a second job acting on Japanese TV and movies here, and do dramas, commercials, etc.
But my goal is to be a comedian.

Telling jokes and making people laugh is what I do best (although you may never have guessed by my direct and to-the-point humorless writing style in 99% of my posts), and I don’t consider any shame in telling a joke in an interview.

For what it is worth, he debased himself no less than I did when I asked about the dress code and he replied, “Hmm, maybe pajamas are okay, though no one has ever really tried that.” He said he likes to joke, too.

The way I see it, such a question is a sign of an easy-going company where my sense of humor will be appreciated.

L. Spiro

##### Share on other sites
Know your elementary data structures and algorithms. Linked lists, hash tables, etc.

Some key C++ concepts to make sure you're comfortable with:
- references, pointers
- const correctness
- virtual functions, when/why virtual destructors are needed
- copy constructors and copy assignment operators
- RAII
- The 'Rule of Three' and why it exists
- The basics of exception handling and exception safety.
- Perhaps knowing the basics of templates is a good idea

With depressing/surprising regularity a question such as one of the following will turn up:

1. Write some code to reverse a linked list
2. Write some code to reverse the words in a sentence e.g. "cheese is a kind of meat" -> "meat of kind a is cheese". Can you do it 'in place', without the use of an additional buffer/string?

Otherwise, look at the company's core competencies and try to extrapolate the sort of code they might be writing. Will you have to brush up on graph theory? Will you be writing 'systems' code? Will you have to know the ins and outs of a typical rendering pipeline? etc.

Look at the job description. Does it mention anything you're unfamiliar with? Find out a little bit about those things. I wouldn't recommend trying to learn them end-to-end, as they've asked you in for an interview anyway, so obviously aren't too bothered that you don't know it, but it's good to have things to discuss and will allow you to queue up a question for when you're inevitably asked "do you have any questions for us?". But do make sure you really know everything you've said on your C.V. Lots of people will put "technology X", even though they only used it for a month 5 years ago. Don't let this catch you out; the mention of "Technology X" might be what they initially liked about you.

Though YogurtEmperor got away with it, a joke which is essentially about rape might not go town too well with some prospective employers. I'd prepare a safer one

##### Share on other sites

Though YogurtEmperor got away with it, a joke which is essentially about rape might not go town too well with some prospective employers. I'd prepare a safer one

I was worried about telling this particular joke, but it was a joke I had told within the last few days, so it was the only one to come to mind.
So I basically pretended I was struggling with morals for a few seconds before I told the joke.

But I agree it was risky. I was really worried it might offend them rather than make them laugh.
I got lucky. You might not (especially if you don’t live in Japan), so choose your jokes carefully.

By the way, while I am here, I can mention some of the questions they asked in the technical interview that were not mentioned before in the previous thread.
#1: You have a CMatrix class with a 4×4 array of floats as a member, declared as:
float m0[4][4];
Declare an overloaded [] operator that would allow the following:
float fM = mMatrix[3][2]; // mMatrix is a CMatrix object.

#2: Describe an algorithm for detecting if point P is inside triangle A0, A1, A2, assuming point P lies on the same plane as the triangle.

#3: Describe an algorithm for finding the distance between point P and a plane defined by the 3 points A0, A1, A2.

L. Spiro

##### Share on other sites

I would have flat refused, then walked if they pushed me on it. What a bizzare request, basically "will you debase yourself for me on my whim?".

Bah. 'Being a good fit' is important in pretty much any job. If you're a good programmer, but everyone hates you the team isn't going to work so well. Plus it provides insight to how well you think on your feet and what sort of person you are.

##### Share on other sites
I absolutely agree, that's the point I was making?

##### Share on other sites
I would also consider telling the sickest, filthiest mosy disgusting joke I could think of just to bask in the awkwardness, for a fun anecdote.

##### Share on other sites
I agree with edd, data structures and algorithms are the main thing you will be asked about in ANY tech interview. I can teach you how to write shader code or how to multithread physics, but if you don't know what a hash table is then you're pretty much useless. Learn core concepts. Also, try to show a deep knowledge of the language/platform/library that you're using to answer coding questions. If you're using the STL and you allocate a vector and then go through and manually set everything to 0 or NULL or something, that works but if you use an allocator then you're showing me that you have a deeper understanding of the STL (that was just one crappy example but I think you get the idea).

Overall, if you have no passion then you will NOT be hired, no matter how much you know or how good you are. If you have a lot of passion and are pretty good technically (maybe not the top technical candidate but still pretty good) then I'd probably still hire you, since I can fill in the gaps in your knowledge easily but if you don't care about what you're working on, then you're useless.

##### Share on other sites
I agree with the "know your datastructures and algorithms" part, but be prepared to also be tested on how you go about solving a problem. Typical questions go along the lines on "how many telephone booths are in <insert city or country>?" or "How many cows are needed to produce the amount of milk needed to make all the vanilla ice consumed by all the new yorkers during a year?" While you probably stand no chance on getting the correct answer to any of these questions the way you go about finding an answer to them will tell your interviewers quite a bit about you. Explain your thinking process and don't just spit out a random number and don't say: "Google it" ;).