C++ Interview Questions and Answers

C++ Interview Questions and Answers

Top C++ Interview Questions and answers: Here, we highlight some common questions you might be asked during a job interview for C++ related positions. All the best for your interview Preparation.

Explain abstraction?

What is the real purpose of class – to export data?

What things would you remember while making a interface?

Explain the benefits of proper inheritance.

Does improper inheritance have a potential to wreck a project?

How should runtime errors be handled in C++?

When should a function throw an exception?

Where are setjmp and longjmp used in C++?

Are there any special rules about inlining?

Explain one-definition rule (ODR)

What are the advantages of using friend classes?

What is the use of default constructor?

Differentiate between class and structure?

Explain container class?

What is namespace?

Explain explicit container?

Explain class invariant

Differentiate between late binding and early binding. What are the advantages of early binding?

Explain public, protected, private in C++?

What are the different types of STL containers?

Explain Stack unwinding?

How would you find out if a linked-list is a cycle or not?

Explain Copy Constructor

When do you call copy constructors?

Name the implicit member functions of a class

Explain storage qualifiers in C++

Explain dangling pointer

In what situations do you have to use initialization list rather than assignment in constructors.

When does a class need a virtual destructor?

What is the type of “this” pointer? When does it get created?

How would you differentiate between a pre and post increment operators while overloading?

What is a pdb file?

You run a shell on UNIX system. How would you tell which shell are you running?

What are Stacks? Give an example where they are useful

Differentiate between an external iterator and an internal iterator? What is the advantage of an external iterator?

Do you think the following code is fine? If not, what is the problem?

In a function declaration, what does extern mean?

You want to link a C++ program to C functions. How would you do it?

Explain STL?

Follow us on Social Media

Related Posts

No Comments

Post a Reply