Вы находитесь на странице: 1из 2

C++ interview questions

1. overload new operater.


2. Difference between Op new and new operator
3. Explain placement new and why n when it is used
4.is there a placement delete.
5. Explain the error when new fails
6.malloc vs new
7.what is name mangling
8.what are proxy objects ?
9.what is a local class ,sub class ,nested clasd
10.what is object slicing.
11. What is name hiding
12. Explain vtable in detail
13.what is a conversion constructor
14.explain explicit constructor
15.copy constructor vs overloaded assignment operator
16.what are class invariants
17.implement a final class in cpp
18.Write a singleton pattern.is it threadsafe ?where it is used.
19.how stl map is implemented internally??
20.how vector allocate memory or how it works internally.can you write your own vector ?
21.what are smart pointers .unique_ptr vs auto_ptr vs shared_ptr?
22. Queue vs priority queue.can you implement or write your own priority queue.
23. Vector vs list vs deque vs map. Which one should u use under what situation
24.what are function pointers , call back functions. What are advantages
25.list x ;list x(); what is the difference here
26.what is synchronous and asynchronous calls/functions or operations
27.what tools u have used for performace checking.how u detect memory leaks.
Explain how you can detect memory leak,mem corruption.what is dangling pointer
28.have u worked with gdb ,dbx,valgrind ??
29.overloading on const
30.design patterns used in ur project. Explain and write abstract factory,visitor etc
31.how to remove duplicates from vector with single traversal.
32.why private constructor is used. how to handle exceptions in a constructor ?and do we need to
handle exceptions in destructor ??
33.How iterator invalidation works in vector,dq,list
34.efficient method of removing odd elements from vector
33.how to sort a vector containing pair elements
34.how to add an element to the front of a vector
35.difference betwn map::find() vs map::operator[ ]
36.are pure virtual methods allowed in a template class
37.can we have static virtual function
38. Function pointer vs function objects

39.map vs hash_map
40.why shoyld you use obj.empty() over (obj.size() ==0) to check emptyness
41.difference between convrsion functionand overloaded function call operator
42. Implement pre and post imcrement operator.
43.how reserve() , capacity() and resize() works in vector
44.what is infamous swap trick on vector ? How to downsize a vector
45.should we use global find algorthm or member function find() for map/set ?
46.how to call/use base class virtual function by a derived class which has already ovrridden it ?
47.can virtual function be private ??
48.issues with pass by value of a class object
49. Int *p=null ; int &p=null ; are they wrong/correct ??
50.pimpl idiom
51.

Вам также может понравиться