Journal Articles
Browse in : |
All
> Journals
> CVu
> 152
(9)
|
Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xt and user-summary-[publicationtype].xt. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles . The templates will get the extension .xt there.
Title: 6 x 24
Author: Administrator
Date: 03 April 2003 13:15:56 +01:00 or Thu, 03 April 2003 13:15:56 +01:00
Summary:
Body:
Recently, our company has been recruiting C++ programmers and, like any other forward-thinking organisation, we've taken great pains with the interview process, ensuring that we ask the candidates a carefully crafted set of questions to test their knowledge. Being as we are a company that believes in careful research, we did a quick check of a mailing list and borrowed the first set of questions we found there - after all, the combined powers of accu.general are likely to produce a superior set of questions to those we could produce ourselves. Since we also believe in proper testing, we first tried the questions out on our most long-serving programmer to get a truly definitive benchmark set of answers. We are rather pleased with the results and we happily anticipate finding the ideal candidate to work with the rest of our coding team. In the interests of improving the quality of all software teams everywhere, we herewith share our results:
- 1. Who is Bjarne Stroustrup?
-
"He's just this guy, you know"
- 2. On a scale of 0 to 10, where 0 is someone who has never heard of C++ and 10 is Bjarne Stroustrup, how would you rate your C++?
-
11 - did I mention I was once a roadie for Spinal Tap?
- 3. Write a simple Standard C++ program which displays "Hello World" at the command line and starts a new line. Describe how you would modify this program so that it could be built by Microsoft Visual C++ 6.0 without any warnings.
-
#include <Everything> void main() { system("echo Hello World") ; }
For VC++
#include <stdafx.h> void main() { system("echo Hello World") ; }
- 4. What is the difference between a class and a struct?
-
Schools don't teach structs.
- 5. In the context of C++ what is abstraction?
-
Staring into space with a blank expression on my face wondering what my colleague's C++ code is supposed to do.
- 6. In the context of C++ describe the differences between Abstraction and Encapsulation.
-
Encapsulation is how the Ibuprofen is packaged. This is used after the Abstraction phase, when I realise he's used templates, and before I dispatch him to hospital.
- 7. In the context of C++ what is Inheritance? Give an example.
-
It's when my colleague leaves me that source code in his will.
- 8. In the context of C++ what is Polymorphism? Give an example.
-
It's when I have a mutable member of class Parrot.
- 9. What is a virtual function?
-
One I haven't written yet.
- 10. What is a destructor?
-
It's a Transformer 'bot.
- 11. When would you use a virtual destructor?
-
When Toys'R'Us are out of the real ones. A painted Barbie will do in a pinch.
- 12. Does a virtual destructor work the same way as a virtual function?
-
Yes - neither exists, and neither does anything.
- 13. What member functions does the compiler generate for you automatically?
-
The constructor and destructor. (Or is that the VC++ class wizard?)
- 14. How should you write a copy constructor?
-
By pasting in someone else's source code.
- 15. What does the const keyword do, and where do you use it?
-
It causes compilation errors, so I don't.
- 16. What are namespaces, and why are they useful?
-
They're a way of pretending my global variables aren't global, and therefore good for fooling my colleague who thinks he's a better programmer than me just because he doesn't use globals.
Paul Grenyer originally posted these questions on accu.general, and Alan Bellingham is the longest serving programmer at his company, showing that twelve years C++ experience can sometimes be six month's experience twenty-four times over.
Notes:
More fields may be available via dynamicdata ..