0% found this document useful (0 votes)
32 views2 pages

Interview Questions

The document contains various questions and answers related to C++ concepts. Some key topics covered include: swapping two variables without a third variable; why constructors cannot be made virtual; the difference between malloc and new when creating objects; preventing object copying by defining the copy constructor and assignment operator as private; and using mutexes and semaphores for multithreading.

Uploaded by

Mahesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views2 pages

Interview Questions

The document contains various questions and answers related to C++ concepts. Some key topics covered include: swapping two variables without a third variable; why constructors cannot be made virtual; the difference between malloc and new when creating objects; preventing object copying by defining the copy constructor and assignment operator as private; and using mutexes and semaphores for multithreading.

Uploaded by

Mahesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

NCR Corporate:

----------------
1. Swapping two variables without using third variable.
Answer:
void main()
{
int x = 10, y = 20;
x = x + y;
y = x - y;
x = x - y;
printf("After swapping x = %d and y = %d",x, y);
}

2. virtual constructor

Answer : contructor can not be made as virtual, because constructor will be


called only once at the time of creating an object. If we make constructor as
virtual,
then it will become virtual function and address will be stored in VTABLE. So,
It can't be invoked.

3. static constructor
Answer : The purpose of a constructor is to initialize the contents of an
instance of the class.
Static methods dont have an instance associated with them.
Hence there is no such thing as a static constructor.

4. malloc and new (can we write in c++)


Answer: malloc() will not call the constructor when we create any object from
the class.
new operator will call the constructr when we create any object from
the class.
5. Modal and Modeless dialog box.
6. Polymorphism
7. Vector and List
8. Interface(By default all functions which are defined in interface are pure
virtual functions.)
9. Macro and Inline
10. Multithreading (Mutex, Event)
11. How do you prevent object copying?
Answer : By defining copy constructor and overloaded assignment operator in
private section.
12. Why we are using Design patterns?

-----------------------------------------------------------------------------------
------------------------------------------------

1. How to debug and fix the problems.


2. What are the modules in project.
3. How to maintain source code.
4. Multithreading(Mutex, Semaphore, Critical Section).
5. Modal & Modeless dialog boxes in your project.
6. Copy constructor in your projector.

NCR Interview Questions:


========================
1. How you can fix the bugs in your project.
2. what is the procedures your are following to fix the bugs fixing.
3. what is inline function and macros function.
4. what is preprocessor.
5. what is constant_cast.
6. whai is file in c.
7. what is pointers in C and C++.
8. bug fix tools.
9. what is recent enhancement in u r project.

-----------------------------------------------------------------------------------
--------------------------------------------------
Interview Questions(Sowjanya)
------------------------------
constructor
destructor
overriding and overloading
malloc and new
runtime polymorphism
copy constructor
deep copy and shallow copy
vector and list
OOPs concepts.
searching element
IPC
Access specifiers
defference C and C++
inline and macro

NCR Questions(Chaitanya)
-------------------------
about yourself and your experience
message map macro mechanism.
virtual function mechanism.
Object oriented language
About DLL(static linking, dynamic linking)
msxml
crash analysis
windbg tool
where did you involved in your project.
Agile
Multithreading.
Single linked list and circular linked list.
Array and vector

copy constructor.

You might also like