C++ Interview Questions
Q1. Restrict class instance to be created on heap so that object can be created only on stack. => stack_but_no_heap.cpp
Q2. Restrict class instance to be created on stack so that object can be created only on heap. => heap_but_no_stack.cpp
Q3. What is size of empty class? => [EmptyClassSize.cpp] (/EmptyClassSize.cpp)
Q4. Write your own string class => [MyString.cpp] (/MyString.cpp)
Q5. Implement smart pointer => [SmartPtr.cpp] (/SmartPtr.cpp)
Q6. Reverse given array => [Reverse_Array.cpp] (/Reverse_Array.cpp)
Q7. How to identify size of integer without using sizeof operator? => [sizeof_int.cpp] (/sizeof_int.cpp)
Q8. Bubble sort program => [bubblesort.cpp] (/bubblesort.cpp)
Q9. Singleton pattern => [singleton.cpp] (/singleton.cpp)
Q10. Functor example => [functor.cpp] (/functor.cpp)
Q11. Find second largest element in array => [Second_largest.cpp] (/Second_largest.cpp)
Q12. Print a matrix in spiral form => [matrix_spiral.cpp] (/matrix_spiral.cpp)
Q13. auto keyword in C++ 11 => [auto.cpp] (/auto.cpp)
Q14. override and final in C++ 11 => [override_keyword.cpp] (/override_keyword.cpp)
Q15. final in C++ 11 => [final_keyword.cpp] (/final_keyword.cpp)
Q16. unique_ptr, shared_ptr and weak_ptr in C++ 11 => [unique_shared_weak_ptr.cpp] (/unique_shared_weak_ptr.cpp)
Q17. lambda function in C++ 11 => [lambda.cpp] (/lambda.cpp)
Q18. Handling failure of new => [new_handler.cpp] (/new_handler.cpp)
Q19. Template vs macro => [template_vs_macro.cpp] (/template_vs_macro.cpp)
Q20. What will happen if I write 'delete this' in member function or in destructor? => [delete_this.cpp] (/delete_this.cpp)
Q21. What if memset called in constructor of class with virtual methods? => [memset_with_virtual.cpp] (/memset_with_virtual.cpp)
Q22. How to add and substract numbers without using arithemetic operators? => [add_sub_without_op.cpp] (/add_sub_without_op.cpp)
Q23. Matrix class => [matrix.cpp] (/matrix.cpp)
Q24. const pointer and pointer to const => [const_pointer.cpp] (/const_pointer.cpp)
Q25. Why do we need virtual destructor? Does it need even when there is no virtual function in class? => [virtual_destructor.cpp] (/virtual_destructor.cpp)
Q26. Double pointers => [double_pointer.cpp] (/double_pointer.cpp)
Q27. Copy constructor => [copy_constructor.cpp] (/copy_constructor.cpp)
Q28. Range based for loop in C++ 11 => [range_for_loop.cpp] (/range_for_loop.cpp)
Q29. STL vectors => [stl_vector.cpp] (/stl_vector.cpp)
Q30. Array storing pointers and double pointers => [array_of_pointers.cpp] (/array_of_pointers.cpp)
Q31. STL map => [stl_map.cpp] (/stl_map.cpp)
Q32. static keyword => [static.cpp] (/static.cpp)
Q33. Virtual functions and polymorphism => [polymorphism.cpp] (/polymorphism.cpp)
Q34. Class for dynamic array creation => [dynamic_array_class.cpp] (/dynamic_array_class.cpp)
Q35. What is a diamond inheritance problem and a solution => [diamond_prob.cpp] (/diamond_prob.cpp)
Q36. Reversing singly linked list => [reverse_singly_llist.cpp] (/reverse_singly_llist.cpp)
Q37. How to find size of array? => [array_size.cpp] (/array_size.cpp)
Q38. Mutable keyword => [mutable.cpp] (/mutable.cpp)
Q39. Selection sort implementation => [selection_sort.cpp] (/selection_sort.cpp)
Q40. Insertion sort implementation => [insertion_sort.cpp] (/insertion_sort.cpp)