http://www.futurechips.org/chip-design-for-all/software-interview-quiz.html
Unlike "brain teaser" quizzes (I hate those), this one covers straightforward working knowledge.
He emphasizes hardware; there is a lot more breadth to software engineering than his quiz covers. But I like its spirit of directness. It does not try to be clever. Clever tests remind me of that Tony Wilson quote about jazz in 24 Hour Party People:
Jazz is the last refuge of the untalented. Jazz musicians enjoy themselves more than anyone listening to them does.
Likewise for clever employment exams.
This quiz on FutureChips inspired me to think of a standardized programming test and to contribute some candidates for questions.
I'd like to see more people write things like this -- quiz questions that test straightforward knowledge on various topics, to be used as a programming test. Nothing too fancy, and nothing meant to stump somebody. Nobody programs with adversarial judges looking over their shoulder. These should be questions that you can answer, if you have the appropriate experience and training, in a quiet moment alone in a room without distractions.
What's great about these kinds of questions is that there is no way to cheat. Even if you knew the questions in advance, if you bothered to learn the answers then you have edified yourself. Well done! Whereas I suspect that people who perform best on brain teasers have merely seen those questions before. (There are dozens of books on the subject and lots of people read them.) I doubt people receive bolts of inspiration while standing at a whiteboard lit by fluorescent lights, facing a dull, ambiguous and contrived question while two dubious people glare at you, resenting you for falling behind schedule while this interview consumes their valuable time, especially when you're more senior than they are and they have a chip on their shoulder about the girth of your considerable resume compared to theirs.
To some extent, the computer science Graduate Record Examimation (GRE) defines the canon of computer science. But it relegates a number of topics to the "Other Topics" category, which occupies only 5% of its questions. I find that much day-to-day game development entails issues in that category. In contrast, relatively little day-to-day game development deals with dynamic programming or combinatorics, which occupy a much larger fraction of the GRE.
Questions I'd like to see replace brain teasers on employment exams:
OOP and C++:
What are principle features or aspects of object-oriented programming?
What tokens or keywords in C++ correspond to each? Write a tiny code snippet to demonstrate each.
Explain how a compiler implements virtual methods. Discuss the relative merits and uses of virtuals and templates. How are they similar and how do they differ? What are the runtime and memory impacts of each?
What problem does virtual inheritance solve?
Cite a real-world example where you would need to use placement new and explicit destructor call.
When and why would you need a virtual destructor? Why is there no such thing as a virtual constructor? Does the fact that C++ does not support virtual constructors mean that they're not useful? What would a virtual constructor mean? How would you implement one in C++?
3D math:
What is the geometric interpretation of a dot product? What is the formula? What practical uses does it have? Ask the same question for the cross product. Then again for matrix-vector product.
Compute the distance from point to plane.
What is the geometric interpretation of a unit vector? Write down the formula for computing it. What is the worst runtime problem of that formula? How would you improve it?
What kind of matrix does not have an inverse? What is the geometric interpretation of that situation?
Calculus and numerical methods:
What are the first and second derivatives with respect to x of A*x^n and A*e^x? What assumptions did you make in your answer? What is its geometric interpretation? Write a C++ subroutine to compute a numerical approximation of the derivative. What practical use does it have? Ask the same question for integrals.
Given the derivative of a function f'(t;A,B,n)=A*t^n+B*e^t, write a C++ subroutine that computes it. You are given the value of f(t0) and f'(t0), for some (given) value of t0 (a float) and n (an integer). Write a subroutine to compute the value of f(t) for any value of t. What is the practical use for such a program?
Data Structures and Algorithms
The obligatory...
Implement a linked list class.
Implement a stack.
Implement a hash table.
What's nifty about these is that you can ask a lot of follow-on questions about assumptions, run-time performance (which dabbles in theory of computation), optimization, how to make the code generic using templates, ask about memory fragmentation and allocators -- practical issues where the answers reveal quantity of industry experience. So the point is less about looking for correctness of answers (because humans don't need to replicate compilers for syntax checking) and more of a scale of how far along a line of questions they get before time runs out.
Discuss!
Which of the above do you like or dislike? Why?
How would you change them?
What questions would you add?

3 comments:
Looks like a good set of questions to me.
I think I would do well on the OOP, C++, data structures, and algorithms questions. I am less certain of how I would do on the math questions.
Would you expect a good applicant to handle all of these questions with ease, or would you expect that to depend on what position the applicant is applying for?
"What are the principal features or aspects of OOP?" is a question I can't see myself asking - the phrasing is wide-open, but most "correct answers" to that kind of question that I've run across are actually expecting regurgitation of some textbook-style list.
Nathan: Perhaps the math questions would be aimed only at people who want to do graphics, physics or animation. I've had a lot of feedback indicating that not many people remember that stuff and that they never use it in their day-to-day work. Since the point of the test is, IMHO, to capture skills they would use at least once per cycle, then I'd concede to omit the math for programmers who don't use it.
Tom: That's why I followed up with phrased the question as "What tokens or keywords in C++ correspond to each? Write a tiny code snippet to demonstrate each." The answers I'm looking for (for the first part) are abstraction, encapsulation, inheritance and polymorphism. For the second, I'm looking for simple symbols like ":" for inheritance, "virtual" and "template" for polymorphism, "private, protected and public" for encapsulation and "class" for abstraction.
Post a Comment