Over the past couple of years, I've interviewed a lot of folks for development positions - mostly C++ and COM on Windows. Some people are outstanding, some are truly horrible; but a large number of people seem bright, but just don't have the depth of knowledge that I think a professional C++ developer should have.
What follows is a list of questions that I typically ask interview candidates. No, I'm not going to give you the answers - that's up to you. Someday, you'll be sitting across from me or someone like me, and they'll ask you questions like these.
When that happens, resist the temptation to give a pat, memorized answer. You should be able to take any one of these questions, and talk about each one with an interviewer for at least five minutes or so. The type of candidate that really impresses me is not the one who can answer using the fewest words, it's the one that knows something well, and can explain it to me.
General Questions
These are questions I tend to ask at the beginning or at then end of an interview. There are no right or wrong answers - the intent is to find out more about a candidate, and to get them comfortable talking about themselves.
How did you get into computer science?
What kind of technical publications (print or online) do you read on a regular basis?
What was the last book you read (does not have to be job related!)
If you could recommend one resource (book, web site, etc.) to a new software developer just out of school, what would it be?
What was the most interesting project that you worked on?
What was the most challenging project that you worked on?
If you could have any job in the world, what would it be?
C++ Questions
What are the major differences between C and C++?
What are the differences between new and malloc?
What is the difference between delete and delete[]?
What are the differences between a struct in C and in C++?
What are the advantages/disadvantages of using #define?
What are the advantages/disadvantages of using inline and const?
What is the difference between a pointer and a reference?
When would you use a pointer? A reference?
What does it mean to take the address of a reference?
What does it mean to declare a function or variable as static?
What is the order of initalization for data?
What is name mangling/name decoration?
What kind of problems does name mangling cause?
How do you work around them?
What is a class?
What are the differences between a struct and a class in C++?
What is the difference between public, private, and protected access?
For class CFoo { }; what default methods will the compiler generate for you>?
How can you force the compiler to not generate them?
What is the purpose of a constructor? Destructor?
What is a constructor initializer list?
When must you use a constructor initializer list?
What is a:
Constructor?
Destructor?
Default constructor?
Copy constructor?
Conversion constructor?
What does it mean to declare a...
member function asvirtual?
member function asstatic?
member function asstatic?
member varible as static?
destructor as static?
Can you explain the term "resource acqusition is initialization?"
What is a "pure virtual" member function?
What is the difference between public, private, and protected inheritance?
What is virtual inheritance?
What is placement new?
What is the difference between operator new and the new operator?
What is exception handling?
Explain what happens when an exception is thrown in C++.
What happens if an exception is not caught?
What happens if an exception is throws from an object's constructor?
What happens if an exception is throws from an object's destructor?
What are the costs and benefits of using exceptions?
When would you choose to return an error code rather than throw an exception?
What is a template?
What is partial specialization or template specialization?
How can you force instantiation of a template?
What is an iterator?
What is an algorithm (in terms of the STL/C++ standard library)?
What is std::auto_ptr?
What is wrong with this statement? std::auto_ptr ptr(new char[10]);
It is possible to build a C++ compiler on top of a C compiler. How would you do this? (Note: I've only asked this question once; and yes, he understood that I was asking him how cfront was put together. We hired him.)/i>
Code Snippets
I like to put these up on a whiteboard, and ask questiosn about them.
What output does the following code generate? Why?
What output does it generate if you make A::Foo() a pure virtual function?
#include
class A {
public:
A() {
this->Foo();
}
virtual void Foo() {
cout << "A::Foo()" << endl;
}
};
class B : public A {
public:
B() {
this->Foo();
}
virtual void Foo() {
cout << "A::Foo()" << endl;
}
};
int main(int, char**)
{
B objectB;
return 0;
}
What output does this program generate as shown? Why?
#include
class A {
public:
A() {
cout << "A::A()" << endl;
}
~A() {
cout << "A::~A()" << endl; throw "A::exception";
}
};
class B {
public:
B() {
cout << "B::B()" << endl; throw "B::exception";
}
~B() {
cout << "B::~B()";
}
};
int main(int, char**) {
try {
cout << "Entering try...catch block" << endl;
A objectA;
B objectB;
cout << "Exiting try...catch block" << endl;
} catch (char* ex) {
cout << ex << endl;
}
return 0;
}
Misc. Questions
What's the difference between SQL, DDL, and DML?
What's a join? An inner join? An outer join?
Describe HTTP.
What's a design pattern?
Can you explain the singleton, vistor, facade, or handle class design pattern?
Additional Links
HYPERLINK "http://www.softcorp.demon.co.uk/c++2.htm" Wanted: Senior C++ Programmer by Al Stevens
HYPERLINK "http://www.ddj.com/articles/1998/9813/9813d/9813d.htm" Passing the C++ Test: Securing success in an interview by Al Stevens
HYPERLINK "http://members.home.net/shimonp/Interview/interview_right.html" The IT Interview User Guide
HYPERLINK "http://www.cpuniverse.com/jobs/c++.shtml" The C++ Interview
HYPERLINK "http://www.4guysfromrolla.com/webtech/012700-1.shtml" Microsoft Interview Questions & Answers
Programming Interview Exposed by John Mongan and Noah Suojanen (ISBN 0471383562)
From HYPERLINK "http://www.amazon.com/exec/obidos/ASIN/0471383562/qid=966272233/102-6880095-8004119" Amazon
From HYPERLINK "http://www1.fatbrain.com/asp/bookinfo/bookinfo.asp?theisbn=0471383562&from=MJF138" Fatbrain
HOME
YEAR N ORG
- C++ (1)
- CISCO 2000 (1)
- CISCO IN ISI (1)
- CISCO SELECTION PROCEDURE (1)
- CTS-JUNE-2005 (1)
- GD TIPS (1)
- GE-NIT-CALICUT-06 (1)
- HCL 1995 (1)
- HCL INTERIVIEW (1)
- HUGHES - 2003 (1)
- HUGHES DELHI 1997 (1)
- HUGHES-26/12/03 (1)
- I'VIE QNS TECH COMP (1)
- I'VIEW HOW TO DRESS (1)
- I'VIEW QNS AT EBAY (1)
- I'VIEW QNS ON C (1)
- I'VIEW QNS ORACLE (1)
- I'VIEW TIPS (TEAM) (1)
- I'VIEW TIPS 1 (2)
- I'VIEW TIPS 2 (1)
- I'VIEW TIPS 3 (1)
- I'VIEW TIPS 5 (1)
- I'VIEW WAY OF ANSWERING (1)
- IBM - 2006 (1)
- INFOSYS DCE DELHI 2K (1)
- INFOSYS 1997 (1)
- INFOSYS 1998 (1)
- INFOSYS CET 2000 (1)
- INFOSYS I'VIEW 05 (1)
- INFOSYS IISC (1)
- INFOSYS IISC 2K (1)
- INFOSYS IISC B'LORE (1)
- INFOSYS IITB 2000 (1)
- INFOSYS IITD 2000 (1)
- INFOSYS IT BHU 2K (1)
- INFOSYS PAPER (1)
- INFOSYS PAPR 97 (1)
- INFOSYS QNS (1)
- INFOSYS QYESTIONS (1)
- INFOSYS TECH LTD (1)
- INFOSYS VJIT 2000 (1)
- INFOSYS-BANGLORE-2006 (1)
- interview tips (1)
- ORACLE CANDIDATE EXP (1)
- ORACLE CHENNAI 13/07/03 (1)
- Oracle OFF CAMP (1)
- ORACLE-2001 (1)
- ORACLE-GUIDANCE (1)
- ORACLE-NITK-11/07/03 (1)
- ORACLE-OF CAMPUS 22/06/06 (1)
- ORACLE-OFCAMP -21/06/03 (1)
- ORACLE-OFCAMP 21/06/03 (1)
- ORACLE-OFCAMP-JULY 2003 (1)
- ORACLE-RECW-2003 (1)
- PATNI 1999 (1)
- RESUME 2 (1)
- RESUME 3 (1)
- RESUME 4 (1)
- RESUME 5 (1)
- RESUME 6 (1)
- RESUME 7 (1)
- SAS (1)
- SASKEN SEP 2003 (1)
- SATYAM 2K3 (1)
- SATYAM 2003 (1)
- SATYAM PAPER (1)
- SATYAM PAPER - GD (1)
- SATYAM PAPER CAND EXP (1)
- SATYAM PATTERN (1)
- SATYAM SAMPLE TEST (1)
- SATYAM2003 (1)
- SQL (1)
- Tcs (1)
- TCS - 2006 (1)
- TCS -JADAVPUR UNI 99 (1)
- TCS 01/07/06 PAPER I'VIEW (1)
- TCS 1998 (2)
- TCS 2000 (1)
- TCS 2003 (1)
- TCS B'LRE 23/09/06CAND EXP (1)
- TCS CAND EXPERIENCE (1)
- TCS CHENNAI 10/12/06 (1)
- TCS COBOL PAPER (1)
- TCS HYD 07/10/06 (1)
- TCS HYD 07/10/06 CAND EXP (1)
- TCS I'VIEW (1)
- TCS MODEL PAPER (1)
- TCS PAPER (1)
- TCS PAPER 1998 (1)
- TCS PAPER 2000 (1)
- TCS PAPER I'VIEW 24/07/06 (1)
- TCS PAPER1 (1)
- TCS PATTERN CAND EXP (1)
- TCS PONDY 02/06/07 I'VIEW (1)
- TCS RANCHI 24/07/06 (1)
- TCS ROORKEE 31/07/97 (1)
- TCS SAMPLE TEST 1 (1)
- TCS SAMPLE TEST 2 (1)
- TCS TALENT TEST 1 (1)
- TCS-HYD-20/10/06 (1)
- TEX TECH TEST 2003 (2)
- TEXAS PAPER 2000 (1)
- TEXAS 1999 (1)
- TEXAS 28/07/08 (1)
- TEXAS CSE 2001 (1)
- TEXAS IISc (1)
- TEXAS IITB (1)
- TEXAS IITK (1)
- TEXAS INSTR PAPER (1)
- TEXAS JADAVPUR 99 (1)
- TEXAS PAPER (1)
- TEXAS REC 2000 (1)
- wipro (1)
- WIPRO 1995 (1)
- WIPRO 1999 (1)
- WIPRO 2000 (1)
- WIPRO 2K (2)
- WIPRO INTERVIEW (1)
- WIPRO INTERVIEW 95 (1)
- WIPRO JULY 1997 (1)
- WIPRO NITDURGAPUR 03 (1)
- WIPRO PAPER 2000 (1)
- WIPRO PROCESS B'LORE (1)
- WIPRO ROORKEE 2K (1)
- WIPRO SAMPLETEST 2 (1)
- WIPRO SAMPLETEST1 (1)
- WIPRO SMAPLETEST 3 (1)
- WIPRO SURAT 2002 (1)
- WIPRO TECH 2000 (1)
Wednesday, April 18, 2007
interview qns..on c,c++,gen
Posted by
pappuagloco
at
4:53 PM
Labels: C++, I'VIEW QNS ON C
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment