For the past couple of years, my side of Tales from an Interview (from "The Daily WTF") has been from the interviewer’s position. Sela Technology Center and Sela College are constantly looking for talented professionals to fill a variety of positions – developers, architects, to-be-consultants, lecturers and a combination of these jobs.
I have my own share of funny stories from interviews. Probably the funniest one lately was a guy with several years of .NET experience who kept tackling even the most trivial of questions with answers like:
- If I had to do <something>, I’d go look it up on the web.
- If I had to do <something>, you can rest assured it’s going to be the best <something> you have ever seen!
- If I had to do <something>, it would be a <something> that would sell for millions and there would be no bugs in it because I would test it so well!
- If I had to do <something>, I would instead do <something else entirely> because <something> is not interesting at all.
Now replace <something> with a random simple question like putting objects in a collection, loading information from a database table, or serving a dynamic web page to a visitor, and you get the picture.
Anyway, for now, I’ll just give you my list of questions that I ask in an interview. This is by no means a full list, just some of the stuff I have been asking recently. Some of these questions are fairly difficult, I obviously ask them in an ascending degree of complexity. BTW, you won’t see any ASP.NET/WPF/WCF/TLA questions here, because I wanted to show the bare minimum.
If you can answer every single question without so much as a blink of an eye, I’ll certainly love to know where you live and when we can send a SWAT team to seize you for a job at Sela 😉
For .NET developers:
- What are the methods of System.Object? (Name at least 3, and as you name them, explain what their job is.)
- What does Object.GetHashCode return? What are the requirements from an object’s hash code?
- How are hash codes implemented differently for value types and reference types?
- What are the primary differences between value types and reference types? (Internal representation, allocation, destruction…)
- What facilities does the System.Type class offer?
- What is reflection? Discuss using reflection for obtaining values of internal or private members, or invoking internal or private methods. Discuss the security issues behind reflection.
- How would you implement object serialization? What are the obstacles? What different kinds of serialization does .NET offer?
- How would you implement a singleton? Discuss possible problems with the implementation.
- When does a .NET static constructor get called?
- What’s the purpose of the .NET GC? How does it work? Are there any memory leaks in .NET? How do you find them?
- What’s the purpose of a finalizer in a .NET class? Why do we need it? How do we release unmanaged resources deterministically?
- What kind of advantages can the JIT have over pre-runtime compilation?
- What IPC technologies have you used in .NET? Compare and contrast.
- What’s an AppDomain? What does it enable? How do you use it?
- How are events implemented by the compiler?
- How do you load an assembly dynamically? What’s the difference between loading by name and loading by path?
For C++ developers:
- What are the uses of the const keyword? Why is it important?
- How is a const method implemented? (I.e., what stops me from modifying state.)
- How would you express an interface to a class in C++?
- How do virtual functions get called (at assembly level)?
- What is inlining? How do you achieve inlining? How do you achieve inlining across translation units?
- What are templates? Show some common usages of templates. Discuss uses of meta-programming.
- What are STL iterators all about? What’s the advantage compared to using plain old pointers?
- How would you implement a string class, encapsulating a string of characters? (With several operators like +, +=, ==, =.)
- What are exceptions? How would you deal with resource management when every single line of code can throw an exception?
- How would you diagnose memory leaks at the language level?
- How do you sharpen your technological skills? What are the last 3 books, blogs, magazines that you have read, and what have you learned from them?
- Have you been playing around with the latest bits of <insert here>?
- What’s a thread? Why would you use a thread? What kind of problems ensue?
- How do multiple threads appear to run simultaneously on a single processor? Who maintains the illusion? Discuss the illusion.
- What enables me to use more memory in my applications than I have physically installed on my machine?
- How do you address a situation where you have more client load than your single server can handle? Discuss distribution scenarios and technologies.
There are certainly more that I can’t remember, but the above list as it is doesn’t fit in an hour of an interview anyway.