Professional Interview Question

  • what is static member function  
  • Static function
          1.   can-we-have-a-static-virtual-functions-if-not-then-why
          2.  cannot-move-virtual-function-outside-header

          3. c-virtual-table-layout-of-mimultiple-inheritance

          4. multiple-inheritance-considered-useful/184402074


  • Partial Template specialization
           1. partial-template-specialization
  • Difference between template and macro
           1.  difference-between-macros-and-templates-compilation-build-time
  • What is virtual. 
      Virtual function help us to determine appropriate function at the run time.
  • Where is virtual  table reside 
    • Vtable is created at the compile time. it reside into the compiler.
  • where is virtual pointer reside 
    • Virtual Pointer reside into the Object.
  • are virtual pointer inheritable 
    • Yes
  • How virtual table determine the function 
    • Look into virtual Section
  • template is polymorphic 
    • template is compile time Polymorphism
  • what is static variable 
    • a variable whose scope is limited to the file
  • can static function initialize static variable 
    • No
    • Error: error: invalid use of qualified-name ‘sample::i’
  • should we check with null pointer if we allocate memory with new
    • No Need
  • if we give definition virtual function in derived class that will work 
    • No
  • can c++ check Index out of bound array at compile time 
    • Ans : No
  •  If we have same variable in the base class than into derived class how will you resolve this issue 
    • Scope resolution oeprator
  • What is runtime binding 
    • Virtual function
  • what is ps -elf 
    • We can print the all process along with the full format.
  • find two string in one pattern 
    • how will you delete 5 times older file
    • find /path/to/files* -mtime +5 -exec rm {} \; 
  •  Virtual destructor and purpose
  • Difference between macro and inline
  •     Name hiding can you find a string in a single iteration loop
I hope it mean hashing 

31.what is diffirence between grep and find
Grep : it match the string in particular file
find : it is give file information

32. what is use of cut command
cut : the cut file.

33. what is linux file structure

34. what is purpose of shared library

35. what is purpose of locking thread

36. if two thread are accessing the same thread how will you prevent them
37. what is this pointer
implict pointer

38. can we delete this pointer from destructor
Need to look
39. what is purpose of static library
Archive file
40. why we need interprocess communication
Communication between two process

41.what are the process excute when you run library

42. How do you find memory leak

43. how do you analysis core dump

44. can you return a local variable from function

45. can you write your iterator

46. can you write thread which do a mutex

47. we do not pass the size when we delete array how can compiler
      identify that it needs to delete some amount of memory

48. What is use of double pointer   
49. What is use of function pointer. Where are we using it. how will it define it

50.  What is purpose of function pointer

51. What is return  optimization

52.  why we need virtual base class. what will be the memory layout

53. How do we define virtual base class

54. In linux how will you identify 32 bit or 16 bit machine

55.where does vpointer reside into compiler?

56. what will be the size of following program
      class sample                        class sample
      {                                           {

           public:                               public:                                     
           int a;                                  char b;
           char b;                               int a; 
           void fun1();                        void fun2();
       }                                           }

 57.  what is structure padding

56. where does vpointer points?

58. where is the variable reside in compiler

59. why do we need stack for storing variable

60. what is type casting and where will you use.

61. what is upcasting and downcasting and where will you use

62. what is constructor initialization list and how does it work

63. how will you handle memory leak without using new/delete

64. what is scoped_ptr and how does it work.

65. can you perform min operation in O(1) time in stack

66. can you implement stack using linklist and why do you need it

67. what is the time complexity of push/pop operation in stack

68. can you insert element in stack using O(1) time complexity

69. why do we handle exception through null

68. can we delete this pointer

69. should we check new operation if it fails to allocate memory will you identify multiple occurence of number in O(n) time complexity and O(1) space complexity

71. how will you find missing number in O(1) time complexity
      sum the number and subtract the missing number.

72. Can you print the address of stack element

73. can we virtual keyword in the derived class

74. how can we access base class variable
75. how can we prevent inheritance

76. how can we prevent function overloading


 using namespace std;  
 class sample  
      void fun(int a,int b)const;  
      void fun(int a,int b);  
      /*can not overload */  
      void fun2(int a,int b);  
     void fun2(const int a,const int b);  
      /* can not overloaded */  
      void fun3(int a,int b);  
      static void fun3(int a,int b);  
      /*can not overload */  
      void fun4(int *a,int *b);  
      void fun4(int a[],int b[]);  
 int main()   
      return 0;  
77. why do we need dynamic_cast
78. what is diffrence between const char char*

79.  how can we print vtable address



Binary Tree key Point.

1.What is binary tree.

2. what is maximum height of binary tree

3. how much does binary tree contain maximum node

4. how will you traverse binary tree and explain type of traverse

5. what is binary search tree

6. how will you insert element/delete element in binary tree

7. can binary tree represent by linked list.

 struct node  
  int data;  
  node *left;  
  node *right;  
8. do you know any well known application of binary tree

9. Any live scenario which  may you across in your programming for implementing binary tree

10.What is virtual base class

12. how is the memory layout of virtual base class

13. What is difference between static vs Global variable

14. Reverse the linked list through recursion


16. What is Heap Sort

17. What is singleton design pattern

18. what is disadvantage of singleton design patter

19. In which Category,Will it be considered Design pattern

20. What is Factory Design Pattern.

21. What is abstract Design Pattern

22. What is diffirence between thread and process

23. What is diffirence between semaphore and mutex





Preparation Question

1. What is mutex.

2. what is semaphore

3. what is difference between mutex and semaphore

4. Can you write simple mutex in c++

5. what is this pointer

6.Can we use delete operator in c++ for this pointer

7. static member function can access this pointer

8. what is purpose of static vs shared vs dynamic library

9. Can we return multiple value from c function

11.what is use of double pointer

12.  what is return value optimization

13. What is structure padding

14. what is type casting and where will you use

15. can we handle memory leak without new
Yes with the boost library

16. can you find minimum element in stack in O(1) time.

17. can you implement stack using linked list
18. should we check for  NULL after new operation
19. how will you find the minimum element in O(1) time
 n(n+1)/2 -(sum of n number)

20. What is rule of makefile




24. What is stack unwinding

25.This Pointer  FAQ. 
     a) This can  be used for member function
     b)This can not be used into main function. 
    c)If we allocate memory through new destructor will not call automatic. We need to explicit call delete operator. 

26)Pointer To array.
 using namespace std;  
 #define MAXROW 4  
 #define MAXCOL 4  
 int main()  
  int (*p)[MAXROW]; /* Pointer to array */  
  cout<<sizeof(*p)<<endl; /* size of pointer */  
  cout<<sizeof(int)<<endl; /* size of int */  
  cout<<(sizeof(*p)/sizeof(int)); /* Resultant of this output */    
  p= new int [MAXROW][4]; /* Allocate memory with pointer to array */  
  /* Intialize the Pointer */  
  for(int i=0;i<MAXROW;i++)  
   for(int j=0;j<MAXCOL;j++)  
    p[i][j]= i;  
  int **s;int **s1; /* Double Pointer */  
  s=(int**)malloc(MAXROW *sizeof(int*)); /* Allocate memory */  
  s1 = new int *[MAXROW];  
  for(int i=0;i<MAXROW ;i++)  
   s[i] = (int *)malloc(MAXROW * sizeof(int));      
   s1[i] = new int [MAXCOL];  
  int count=0;  
  for(int i=0;i<MAXROW;i++)  
   for(int j=0;j<MAXROW;j++)  
  Int *a1 = new int[5];  
  Int (*a2)[2] =new int [2][2];  

 27)What is  static object and why we need them.
      28) Should we do self assignment  with copy constructor.

4.   29)Why we need static function.
    The differences between a static member function and non-static member     functions are as follows.
        A static member function can access only static member data, static member functions  and     data and functions outsidethe class. A non-static member function can access all of the   above including the static data member. 
A static member function cannot be declared virtual, whereas a non-static member functions can be declared as virtual

In c, static function can be local to particular file.

     30)What is static class.
     A class which contain only the constructor  and method
         We can write throw and return statement into constructor..
7       Malloc and calloc and realloc

     31)What is segmentation fault.

     32)What is difference between sizeof and strlen

Inheritance Concept

 using namespace std;  
 class base  
         int i;  
                 cout<<" the value of i :"<<i<<endl;  
         void get_base()  
                 cout<<" the value of i :"<<i<<endl;  
 class derived : public base  
         int i;  
                 cout<<" the value of i"<<i<<endl;  
         void get_show()  
                 cout<<" the value of i "<<i<<endl;  
 int main()  
         derived d;  
         return 0;  
 Concept:Data member can be change using scope operator  

Virtual Point.

 1).If we have pure virtual function than we will have vpointer into the


 3).How many vtable create per class. is Vpointer  part of the object

 4).If we add virtual function and we need to provide the definition also. Otherwise we will get error.

 5) Why we need virtual base class 



8)Why we need multiple inheritances.

 General Question 

 1) What is time complexity?  

 2)What is conversion constructo


7)We can create the abstract class object and also assign the derived class object.By default every constructor is inline function In the inheritance, we  get constructor, destructor  and assignment operator We have simple, multilevel  and multiple inheritanc
So we write the following line I t does not call base class constructor and goes through
Derived class constructor.
Base *s= &der; (In compare base *s = new der)

8)What is Call  back mechanism

9)Switch case better if else

10)Where the vtable stored into memory
      It is depend compiler to compiler. Sometime it may store into ROM

11)Can you stop the name mangling
       We can stop the name mangling using the extern keyword
        This pointer can not be modified
12)What is difference   between DLL and exe.

13)What is client server Programing
14)How Tcp/ip work

16)hour and angle problem

17) makefile

18) Some Good interview Question about HR

19)This Pointer with Inheritance:

20) splay tree:


22)Design Pattern Question:

23)Factorials and Trailing zeros

25)quick sort vs merge sort.

 26)quick sort vs heap sort

 27)Input and CPU bound Process

 28)Sorting for duplicate number

 29)Longest Common substring wiki

 30)Prevent object in heap.

 31)Smart Pointer

 32)Bit Manupilation:


34)Some Data Structure Video

35)Why we need fucntion overloading

36)What is difference between where and having clause.

37)What is signal

38)What is difference between  cluster and non cluster index

39)What is difference between union and union all.

40)What is trigger

41)What is fork,vfork and how does create process inside system.

42)What is kernal level thread and application level thred

43)What is kill and how did the remove the process

44)What is process lifecycle

45)What is difference between softlink and hardlink 

46)What is main difference between find and grep except file searching

47)What is difference between more and page.

48)When the this pointer create and what do you know about this pointer.

49) What is object chaining and how does the compiler interpret the object chaining.





54)is static member inherited

55)is operator overloading inherited

56)do we have alternative of void pointer

57)what is difference between vector and set

58)Main info.

59)Friend function limitation.

60)Create binary tree using array

61)Which data structure you will use for storing large data base

62)Reverse a link list without affecting another one.

63)Some Technical Question

Aircom Internation


1) what are the basic concept of OOPS
2) What is Polymorphism
3) What is compile time Polymorphism
4)  is template compile time Polymorphism
5)  What is difference  between shallow copy and deep copy
6)  What is singleton pattern.Can you write code for that
7)  What is facade pattern.
8)  What is observer pattern
9)  What is virtual inheritance
9)  What is diamond shape problem
10) if base class one virtual function and derived class also contain virtual function.How many vtable create
11) When is vtable create ?
12) When is vpointer create ?
13) Can you explain vtable
14) Can you explain the compilation process
15) How the executable execute into system
16) What is the reason behind to decide default argument as trailer argument
17) Why do we need function overloading?
18) Why do we need function overriding?
19) Why do you need static object?.
20) What is static function?.
21) if Class B is Friend of A.Class C is Friend of B.What is the relation between A to C

1) what is sed command
2) what is awk command
3) what is tee command
4) what is difference between grep and find command
5) what is make file rule
6) Find the list of all file which does not contain particular string
7) what is touch command
8) what is main purpose of touch command
9) How will you copy from one machine to another machine
10)how will you delete a line in vi editor
11)How will you delete a word in vi editor
12)How will you delete a single character in vi editor
13)How will you execute a shell command within vi editor.(i.e) you have already
 open file than after you want to execute shell command. How will you execute
 shell command
14)How will you find a string into only particular directory and not recursive directory
15) what is max depth into Linux command
16)How will you search a particular word into vi editor
17)How will you do substitution into vi editor

Template specialization
2. Exception list
3. polymorphism in Python
5. Multithreading vs Multiprocessing
1. In diamond shape problem, How will you set base class variable
2.The constructor should throw exception or not

3. In non virtual class, it should have virtual destrctor
4.How will I read into middle  node of linked list

5. #deefine or const which is better in coding guideline

6. Can pure virtual function have function body? will you write final class


9.serialization, generator and decorator in Python

10.template specilization