Wednesday, November 15, 2023

Basic C++ interview questions for beginners


Check if you can answer following basic questions.

1. Explain the difference between deep copy and shallow copy in C++.

2. What is a constructor, and how does it differ from a destructor in C++?

3. What is the purpose of the `virtual` keyword in C++?

4. Explain the difference between `new` and `malloc()` in C++.

5. What is a smart pointer in C++? How does it differ from a raw pointer?

6. Explain the concept of operator overloading in C++

No comments:

Post a Comment

Optimize you working enviorenment : Single command to create & move to a directory in linux (C Shell, Bash)

Usually move to a directory just after creating is bit of a anxious task specially if the directory name is too long. mkdir long-name-of...