{"iq":[{"id":"1",
"q":"What is C++?",
"answer":"C++ is created by Bjarne Stroustrup of AT&T Bell Labs as an extension of C, C++ is an object-oriented computer language used in the development of enterprise and commercial applications. Microsoft’s Visual C++ became the premier language of choice among developers and programmers. "
},
{"id":"2",
"q":"What are the basic concepts of object oriented programming? ",
"answer":"INHERITANCE\n\nPOLYMORPHYSM\n\nENCAPSULATION\n\nABSTRACTION "
},
{"id":"3",
"q":"Define inheritance?",
"answer":"The mechanism of deriving a new class (derived) from an old class (base class) is called inheritance.\n\nIt allows the extension and reuse of existing code without having to rewrite the code from scratch.\n\nInheritance is the process by which objects of one class acquire properties of objects of another class."
},
{"id":"4",
"q":"Define polymorphism?",
"answer":"Polymorphism means one name, multiple forms. It allows us to have more than one function with the same name"
},
{"id":"5",
"q":"What are the features of C++ different from C?",
"answer":"All the features of C are similiar to C++ except some features, such as polymorphism,operator overloading which are supported in C++ but not in C language.Both C and C++ language is similiar in their functionality but C++ provides with more tools and options."
},
{"id":"6",
"q":"What is an Object/Instance?",
"answer":"Object is the instance of a class, which is concrete. From the above example, we can create instance of class Vehicle as given below\n\n\nVehicle vehicleObject;\n\nWe can have different objects of the class Vehicle, for example we can have Vehicle objects with 2 tyres, 4tyres etc.Similarly different engine capacities as well. "
},
{"id":"7",
"q":"What do you mean by C++ access specifiers ?",
"answer":" Access specifiers are used to define how the members (functions and variables) can be accessed outside the class. There are three access specifiers defined which are public, private, and protected "
},
{"id":"8",
"q":"In how many ways we can initialize an int variable in C++?",
"answer":"In c++, variables can be initialized in two ways, the traditional C++ initialization using \"=\" operator and second using the constructor notation.\n\nTraditional C++ initilization\n\nint i = 10;\n\nvariable i will get initialized to 10.\n\nUsing C++ constructor notation\n\nint i(10);"
},
{"id":"9",
"q":"What is implicit conversion/coercion in c++?",
"answer":"Implicit conversions are performed when a type (say T) is used in a context where a compatible type (Say F) is expected so that the type T will be promoted to type F.\n\nshort a = 2000 + 20;\n\nIn the above example, variable a will get automatically promoted from short to int. This is called implicit conversion/coercion in c++."
},
{"id":"10",
"q":"What is the role of a controller in an MVC application?",
"answer":"The controller responds to user interactions, with the application, by selecting the action method to execute and alse selecting the view to render."
},
{"id":"11",
"q":"Where are the routing rules defined in an asp.net MVC application?",
"answer":"In Application_Start event in Global.asax"
},
{"id":"12",
"q":" Name a few different return types of a controller action method?",
"answer":"The following are just a few return types of a controller action method. In general an action method can return an instance of a any class that derives from ActionResult class.\n\n1. ViewResult\n\n2. JavaScriptResult\n\n3. RedirectResult\n\n4. ContentResult\n\n5. JsonResult"
},
{"id":"13",
"q":"What do you mean by internal linking and external linking in c++?",
"answer":" A symbol is said to be linked internally when it can be accessed only from with-in the scope of a single translation unit. By external linking a symbol can be accessed from other translation units as well. This linkage can be controlled by using static and extern keywords."
},
{"id":"14",
"q":"What do you mean by storage classes?",
"answer":"Storage class are used to specify the visibility/scope and life time of symbols(functions and variables).\n\nThat means, storage classes specify where all a variable or function can be accessed and till what time those variables will be available during the execution of program."
},
{"id":"15",
"q":" How should runtime errors be handled in C++?",
"answer":"-The runtime errors in C++ can be handled using exceptions.\n\n- This exception handling mechanism in C++ is developed to handle the errors in software made up of independently developed components operating in one process and under synchronous control.\n\n- According to C++, any routine that does not fulfil its promise throws an exception. The caller who knows the way to handle these exceptions can catch it."
},
{"id":"16",
"q":"Does improper inheritance have a potential to wreck a project? ",
"answer":"-Many projects meet a dead end because of bad inheritance. So, it certainly has the potential to wreck a project.\n\n- Small projects still have a scope to avoid the complete consequence of bad inheritance if the developers communicate and co-ordinate with an easy system design. This kind of a luxury is not possible in big projects, which means that the code breaks in a way difficult and at times impossible way to fix it. "
},
{"id":"17",
"q":"Where are setjmp and longjmp used in C++?",
"answer":"-Setjmp and longjmp should not be used in C++.\n\n- Longjmp jumps out of the function without unwinding the stack. This means that the local objects generated are not destructed properly.\n\n- The better option is to use try/catch/throw instead. They properly destruct the local objects. "
},
{"id":"18",
"q":" Are there any special rules about inlining? ",
"answer":"Yes, there are a few rules about inlining :\n\n1. Any source files that used the inline function must contain the function’s definition.\n\n2. An inline function must be defined everywhere. The easier way to deal with this to define the function once in the class header file and include the definition as required. The harder way is to redefine the function everywhere and learn the one-definition rule.\n\n3. Main() can not be inline."
},
{"id":"19",
"q":"Explain container class.",
"answer":"-Class to hold objects in memory or external storage. It acts as a generic holder.\n\n- It has a predefined behaviour and a known interface.\n\n- It is used to hide the topology used for maintaining the list of objects in memory.\n\n\n- The container class can be of two types:\n\n1. Heterogeneous container : Here the container class contains a group of mixed objects\n\n2. Homogeneous container : Here the container contains all the same objects."
},
{"id":"20",
"q":"What is namespace?",
"answer":"Namespaces are used to group entities like classes, objects and functions under a name."
},
{"id":"21",
"q":"Explain explicit container.",
"answer":"-These are constructors that cannot take part in an implicit conversion.\n\n- These are conversion constructors declared with explicit keyword.\n\n- Explicit container is reserved explicitly for construction. It is not used by the compiler to implement an implied conversion of types. "
},
{"id":"22",
"q":"Explain Copy Constructor? ",
"answer":"It is a constructor which initializes it's object member variable with another object of the same class.If you don't implement a copy constructor in your class, the compiler automatically does it. "
},
{"id":"23",
"q":"Explain storage qualifiers in C++.",
"answer":"1. Const : This variable means that if the memory is initialised once, it should not be altered by a program.\n\n2. Volatile : This variable means that the value in the memory location can be altered even though nothing in the program code modifies the contents.\n\n3. Mutable : This variable means that a particular member of a structure or class can be altered even if a particular structure variable, class or class member function is constant."
},{"id":"24",
"q":"What is Rendering? ",
"answer":"Rendering is a process of converting complete server side code into client understable code. It will happen before page is submitting to the client."
},{"id":"25",
"q":"What is the type of “this” pointer? When does it get created? ",
"answer":"It is a constant pointer type. It gets created when a non-static member function of a class is called."
},{"id":"26",
"q":"How would you differentiate between a pre and post increment operators while overloading?",
"answer":"Mentioning the keyword int as the second parameter in the post increment form of the operator++() helps distinguish between the two forms."
},{"id":"27",
"q":"What is a pdb file?",
"answer":"A program database (PDB) file contains debugging and project state information that allows incremental linking of a Debug configuration of the program. This file is created when you compile a C/C++ program with /ZI or /Zi or a Visual Basic/C#/JScript .NET program with /debug."
},{"id":"28",
"q":"You run a shell on UNIX system. How would you tell which shell are you running? ",
"answer":"To check this you can simply do the Echo $RANDOM.\n\n\n- The results will be :\n\n1. Undefined variable if you are from the C-Shell,\n\n2. A return prompts if you are from the Bourne shell,\n\n3. A 5 digit random number if you are from the Korn shell. You could also do a ps -l and look for the shell with the highest PID."
},{"id":"29",
"q":"In a function declaration, what does extern mean?",
"answer":"Here, the extern tells the compiler about the existence of a variable or a function, even though the compiler hasn’t yet seen it in the file currently being compiled. This variable or function may be defined in another file or further down in the current file."
},{"id":"30",
"q":"Explain STL. ",
"answer":"STL stands for Standard Template Library. It is a library of container templates approved by the ANSI committee for inclusion in the standard C++ specification."
},{"id":"31",
"q":"Explain Stack unwinding. ",
"answer":"Stack unwinding is a process during exception handling when the destructor is called for all local objects between the place where the exception was thrown and where it is caught."
},{"id":"32",
"q":"How does code-bloating occur in C++?",
"answer":"Improper use of Inline functions and templates may lead to code bloating.\n\n- Multiple Inheritance may also lead to code bloating. "
},{"id":"33",
"q":"Define Constructors?",
"answer":"A constructor is a member function with the same name as its class. The constructor is invoked whenever an object of its associated class is created.It is called constructor because it constructs the values of data members of the class. "
},{"id":"34",
"q":"What is a class?",
"answer":"A class is a collection of objects."
},{"id":"35",
"q":"What are the few advantages of Inline function?",
"answer":"It offers an improved macro facility.By using the inline functions, the user can split a large function with many nested modules of statement blocks into many small inline functions."
},{"id":"36",
"q":"What is copy constructor?",
"answer":"Copy constructor is a constructor function with the same name as the class and used to make deep copy of objects."
},{"id":"37",
"q":" What is default constructor?",
"answer":"A default constructor is a constructor that either has no parameters, or if it has parameters, all the parameters have default values. "
},{"id":"38",
"q":"What is a scope resolution operator?",
"answer":"The scope resolution operator permits a program to reference an identifier in the global scope that has been hidden by another identifier with the same name in the local scope."
},{"id":"39",
"q":"What is the difference between Object and Instance?",
"answer":"An instance of a user-defined type is called an object. We can instantiate many objects from one class.\n\nAn object is an instance of a class."
},{"id":"40",
"q":"What is multiple inheritance?",
"answer":"A class can inherit properties from more than one class which is known as multiple inheritance."
},{"id":"41",
"q":"What do you mean by reference variable in c++? ",
"answer":"A reference variable provides an alias to a previously defined variable.\n\nData -type & reference-name = variable name"
},{"id":"42",
"q":"What is iterator class?",
"answer":"Iterator class provides an access to the class which are inside the containers(it holds a group of objects in an organized way).\n\nThe containers include the data structure, class and abstract data type."
},{"id":"43",
"q":"What are Smart pointers?·",
"answer":" Smart pointers are almost similar to pointers with additional features such as automatic destruction of a variable when it becomes out of scope and the throwing of exceptions that ensures the proper destruction of the dynamically allocated objects."
},{"id":"44",
"q":"Explain function template?",
"answer":" Function template provides a means to write generic functions for different data types such as integer, long, float or user defined objects."
},{"id":"45",
"q":"Explain class template?",
"answer":"Class template provides a means to write a generic class for different types so that a class can have members based on generic types that do not need to be defined at the moment of creating the class or whose members use these generic types."
},{"id":"46",
"q":"What are the advantages of inheritance?",
"answer":"Code reusability Saves time in program development."
},{"id":"47",
"q":"What is a dynamic constructor?",
"answer":"The constructor can also be used to allocate memory while creating objects.\n\nAllocation of memory to objects at the time of their construction is known as dynamic construction of objects.\n\nThe memory is allocated with the help of the new operator."
},{"id":"48",
"q":"What is the use of ‘using’ declaration? ",
"answer":"A using declaration makes it possible to use a name from a namespace."
},{"id":"49",
"q":" What is a scope resolution operator? ",
"answer":"A scope resolution operator (::), can be used to define the member functions of a class outside the class. "
},{"id":"50",
"q":" What do you mean by pure virtual functions? ",
"answer":"A pure virtual member function is a member function that the base class forces derived classes to provide. Any class containing any pure virtual function cannot be used to create object of its own type."
},{"id":"51",
"q":"What is a conversion constructor?Where we will define the session state type? ",
"answer":"A converting constructor is a single-parameter constructor that is declared without the function specifier explicit.\n\nThe compiler uses converting constructors to convert objects from the type of the first parameter to the type of the converting constructor’s class. "
},
{"id":"52",
"q":"What is Associative container?",
"answer":" Associative containers are designed to support direct access to elements using keys. They are not sequential. There are four types of associatives containers :\n\nSet\n\nMultiset\n\nMap\n\nMultimap "
},{"id":"53",
"q":" What is an iterator? ",
"answer":"Iterators are like pointers. They are used to access the elements of containers thus providing a link between algorithms and containers. Iterators are defined for specific containers and used as arguments to algorithms."
},{"id":"54",
"q":"What is this pointer?",
"answer":"It is a pointer that points to the current object. This can be used to access the members of the current object with the help of the arrow operator."
},{"id":"55",
"q":"Name some pure object oriented languages? ",
"answer":"Smalltalk\n\nJava\n\nEiffel\n\nSather"
},{"id":"56",
"q":"What is encapsulation?",
"answer":"Encapsulation (or information hiding) is the process of combining data and functions into a single unit called class."
},{"id":"57",
"q":"What is problem with Runtime type identification? ",
"answer":"The run time type identification comes at a cost of performance penalty. Compiler maintains the class."
},{"id":"58",
"q":"What is conversion operator?",
"answer":"You can define a member function of a class, called a conversion function, that converts from the type of its class to another specified type."
},{"id":"59",
"q":"What do you mean by implicit conversion?",
"answer":"Whenever data types are mixed in an expression then c++ performs the conversion automatically.\n\nHere smaller type is converted to wider type.\n\nExample : in case of integer and float integer is converted into float type."
},{"id":"60",
"q":"What are virtual functions? ",
"answer":"The virtual fuctions must be members of some class.\n\nThey cannot be static members.\n\nThey are accessed by using object pointers.\n\nA virtual function can be a friend of another class."
},{"id":"61",
"q":" What is a friend?",
"answer":"Friends can be either functions or other classes. The class grants friends unlimited access privileges."
},
{"id":"62",
"q":" What is stack unwinding?",
"answer":"Stack unwinding is a process in which a destructor is invoked in a particular program for destroying all the local objects in the stack between throwing and catching of an exception."
},
{"id":"63",
"q":" What is the difference between a copy constructor and an overloaded assignment operator? ",
"answer":"A copy constructor constructs a new object by using the content of the argument object. An overloaded assignment operator assigns the contents of an existing object to another existing object of the same class."
},
{"id":"64",
"q":"Is it possible to get the source code back from binary file?",
"answer":"Technically it is possible to generate the source code from binary. It is called reverse engineering. There are lot of reverse engineering tools available. But, in actual case most of them will not re generate the exact source code back because many information will be lost due to compiler optimization and other interpretations."
},
{"id":"65",
"q":"What is virtual destructors? Why they are used?",
"answer":"Virtual destructors are used for the same purpose as virtual functions. When you remove an object of subclass, which is referenced by a parent class pointer, only destructor of base class will get executed. But if the destructor is defined using virtual keyword, both the destructors [ of parent and sub class ] will get invoked."
},
{"id":"66",
"q":"What is meant by reference variable in C++?",
"answer":"In C++, reference variable allows you create an alias (second name) for an already existing variable. A reference variable can be used to access (read/write) the original data. That means, both the variable and reference variable are attached to same memory location. In effect, if you change the value of a variable using reference variable, both will get changed (because both are attached to same memory location)."
},
{"id":"67",
"q":"What do you mean by a public member?",
"answer":"A member declared as public is a public member.\n\nIt can be accessed freely in a program."
},
{"id":"68",
"q":"How the keyword struct is different from the keyword class in C++?",
"answer":"In C++, a class is similar to a struct with the exception that, by default, all the members of a class are private; while the members of a struct are public. Encapsulation is not supported by structures but supported by classes."
},
{"id":"69",
"q":"What is reference?",
"answer":"Reference is a name that acts as an alias, or alternative name, for a previously defined variable or an object."
},
{"id":"70",
"q":"What is the use of storage class specifiers?",
"answer":"A storage class specifier is used to refine the declaration of a variable, a function, and parameters. The following are storage class specifiers :\n\nauto\n\nregister\n\nstatic\n\nextern"
},
{"id":"71",
"q":"Can destructor be private?",
"answer":"Yes destructors can be private. But according it is not advisable to have destructors to be private."
},
{"id":"72",
"q":"What is strstream?",
"answer":"stringstream provides an interface to manipulate strings as if they were input/output streams.\n\n‹ strstream› to define several classes that support iostreams operations on sequences stored in an allocated array of char object."
},
{"id":"73",
"q":"What do you mean by a template?",
"answer":"Templates enable creation of generic functions that admit any data type as parameters and return value without having to overload the function with all the possible data types unless they fulfill the functionality of a macro.\n\n- Its prototype can be one of the following : template function_declaration; template function_declaration;\n\n- The only difference between both prototypes is the use of keyword class or typename. It's use is indistinct since both expressions have exactly the same meaning and behave exactly the same way."
},
{"id":"74",
"q":"Difference between a copy constructor and an assignment operator.",
"answer":"- A copy constructor is used to declare and initialize an object from another object.\n\n- For Example : integer I2(I1);\n\n- An assignment operator doesnot invoke the copy constructor. It simply assigns the values of an object to another, member by member."
},
{"id":"75",
"q":"What are the various operations performed on stack?",
"answer":"Various operations which can be performed on stack are as follows :\n\ncreatempty() : It creates an empty stack by initializing TOP to -1.\n\nIsempty() : It determines whether stack is empty or not. It returns value 1 if stack is empty otherwise return 0.\n\nPush() : Adding a new element at the top of the stack is called Push.\n\nPop() : Removing an element from the top of the stack is called Pop."
}
]
}
"q":"What is C++?",
"answer":"C++ is created by Bjarne Stroustrup of AT&T Bell Labs as an extension of C, C++ is an object-oriented computer language used in the development of enterprise and commercial applications. Microsoft’s Visual C++ became the premier language of choice among developers and programmers. "
},
{"id":"2",
"q":"What are the basic concepts of object oriented programming? ",
"answer":"INHERITANCE\n\nPOLYMORPHYSM\n\nENCAPSULATION\n\nABSTRACTION "
},
{"id":"3",
"q":"Define inheritance?",
"answer":"The mechanism of deriving a new class (derived) from an old class (base class) is called inheritance.\n\nIt allows the extension and reuse of existing code without having to rewrite the code from scratch.\n\nInheritance is the process by which objects of one class acquire properties of objects of another class."
},
{"id":"4",
"q":"Define polymorphism?",
"answer":"Polymorphism means one name, multiple forms. It allows us to have more than one function with the same name"
},
{"id":"5",
"q":"What are the features of C++ different from C?",
"answer":"All the features of C are similiar to C++ except some features, such as polymorphism,operator overloading which are supported in C++ but not in C language.Both C and C++ language is similiar in their functionality but C++ provides with more tools and options."
},
{"id":"6",
"q":"What is an Object/Instance?",
"answer":"Object is the instance of a class, which is concrete. From the above example, we can create instance of class Vehicle as given below\n\n\nVehicle vehicleObject;\n\nWe can have different objects of the class Vehicle, for example we can have Vehicle objects with 2 tyres, 4tyres etc.Similarly different engine capacities as well. "
},
{"id":"7",
"q":"What do you mean by C++ access specifiers ?",
"answer":" Access specifiers are used to define how the members (functions and variables) can be accessed outside the class. There are three access specifiers defined which are public, private, and protected "
},
{"id":"8",
"q":"In how many ways we can initialize an int variable in C++?",
"answer":"In c++, variables can be initialized in two ways, the traditional C++ initialization using \"=\" operator and second using the constructor notation.\n\nTraditional C++ initilization\n\nint i = 10;\n\nvariable i will get initialized to 10.\n\nUsing C++ constructor notation\n\nint i(10);"
},
{"id":"9",
"q":"What is implicit conversion/coercion in c++?",
"answer":"Implicit conversions are performed when a type (say T) is used in a context where a compatible type (Say F) is expected so that the type T will be promoted to type F.\n\nshort a = 2000 + 20;\n\nIn the above example, variable a will get automatically promoted from short to int. This is called implicit conversion/coercion in c++."
},
{"id":"10",
"q":"What is the role of a controller in an MVC application?",
"answer":"The controller responds to user interactions, with the application, by selecting the action method to execute and alse selecting the view to render."
},
{"id":"11",
"q":"Where are the routing rules defined in an asp.net MVC application?",
"answer":"In Application_Start event in Global.asax"
},
{"id":"12",
"q":" Name a few different return types of a controller action method?",
"answer":"The following are just a few return types of a controller action method. In general an action method can return an instance of a any class that derives from ActionResult class.\n\n1. ViewResult\n\n2. JavaScriptResult\n\n3. RedirectResult\n\n4. ContentResult\n\n5. JsonResult"
},
{"id":"13",
"q":"What do you mean by internal linking and external linking in c++?",
"answer":" A symbol is said to be linked internally when it can be accessed only from with-in the scope of a single translation unit. By external linking a symbol can be accessed from other translation units as well. This linkage can be controlled by using static and extern keywords."
},
{"id":"14",
"q":"What do you mean by storage classes?",
"answer":"Storage class are used to specify the visibility/scope and life time of symbols(functions and variables).\n\nThat means, storage classes specify where all a variable or function can be accessed and till what time those variables will be available during the execution of program."
},
{"id":"15",
"q":" How should runtime errors be handled in C++?",
"answer":"-The runtime errors in C++ can be handled using exceptions.\n\n- This exception handling mechanism in C++ is developed to handle the errors in software made up of independently developed components operating in one process and under synchronous control.\n\n- According to C++, any routine that does not fulfil its promise throws an exception. The caller who knows the way to handle these exceptions can catch it."
},
{"id":"16",
"q":"Does improper inheritance have a potential to wreck a project? ",
"answer":"-Many projects meet a dead end because of bad inheritance. So, it certainly has the potential to wreck a project.\n\n- Small projects still have a scope to avoid the complete consequence of bad inheritance if the developers communicate and co-ordinate with an easy system design. This kind of a luxury is not possible in big projects, which means that the code breaks in a way difficult and at times impossible way to fix it. "
},
{"id":"17",
"q":"Where are setjmp and longjmp used in C++?",
"answer":"-Setjmp and longjmp should not be used in C++.\n\n- Longjmp jumps out of the function without unwinding the stack. This means that the local objects generated are not destructed properly.\n\n- The better option is to use try/catch/throw instead. They properly destruct the local objects. "
},
{"id":"18",
"q":" Are there any special rules about inlining? ",
"answer":"Yes, there are a few rules about inlining :\n\n1. Any source files that used the inline function must contain the function’s definition.\n\n2. An inline function must be defined everywhere. The easier way to deal with this to define the function once in the class header file and include the definition as required. The harder way is to redefine the function everywhere and learn the one-definition rule.\n\n3. Main() can not be inline."
},
{"id":"19",
"q":"Explain container class.",
"answer":"-Class to hold objects in memory or external storage. It acts as a generic holder.\n\n- It has a predefined behaviour and a known interface.\n\n- It is used to hide the topology used for maintaining the list of objects in memory.\n\n\n- The container class can be of two types:\n\n1. Heterogeneous container : Here the container class contains a group of mixed objects\n\n2. Homogeneous container : Here the container contains all the same objects."
},
{"id":"20",
"q":"What is namespace?",
"answer":"Namespaces are used to group entities like classes, objects and functions under a name."
},
{"id":"21",
"q":"Explain explicit container.",
"answer":"-These are constructors that cannot take part in an implicit conversion.\n\n- These are conversion constructors declared with explicit keyword.\n\n- Explicit container is reserved explicitly for construction. It is not used by the compiler to implement an implied conversion of types. "
},
{"id":"22",
"q":"Explain Copy Constructor? ",
"answer":"It is a constructor which initializes it's object member variable with another object of the same class.If you don't implement a copy constructor in your class, the compiler automatically does it. "
},
{"id":"23",
"q":"Explain storage qualifiers in C++.",
"answer":"1. Const : This variable means that if the memory is initialised once, it should not be altered by a program.\n\n2. Volatile : This variable means that the value in the memory location can be altered even though nothing in the program code modifies the contents.\n\n3. Mutable : This variable means that a particular member of a structure or class can be altered even if a particular structure variable, class or class member function is constant."
},{"id":"24",
"q":"What is Rendering? ",
"answer":"Rendering is a process of converting complete server side code into client understable code. It will happen before page is submitting to the client."
},{"id":"25",
"q":"What is the type of “this” pointer? When does it get created? ",
"answer":"It is a constant pointer type. It gets created when a non-static member function of a class is called."
},{"id":"26",
"q":"How would you differentiate between a pre and post increment operators while overloading?",
"answer":"Mentioning the keyword int as the second parameter in the post increment form of the operator++() helps distinguish between the two forms."
},{"id":"27",
"q":"What is a pdb file?",
"answer":"A program database (PDB) file contains debugging and project state information that allows incremental linking of a Debug configuration of the program. This file is created when you compile a C/C++ program with /ZI or /Zi or a Visual Basic/C#/JScript .NET program with /debug."
},{"id":"28",
"q":"You run a shell on UNIX system. How would you tell which shell are you running? ",
"answer":"To check this you can simply do the Echo $RANDOM.\n\n\n- The results will be :\n\n1. Undefined variable if you are from the C-Shell,\n\n2. A return prompts if you are from the Bourne shell,\n\n3. A 5 digit random number if you are from the Korn shell. You could also do a ps -l and look for the shell with the highest PID."
},{"id":"29",
"q":"In a function declaration, what does extern mean?",
"answer":"Here, the extern tells the compiler about the existence of a variable or a function, even though the compiler hasn’t yet seen it in the file currently being compiled. This variable or function may be defined in another file or further down in the current file."
},{"id":"30",
"q":"Explain STL. ",
"answer":"STL stands for Standard Template Library. It is a library of container templates approved by the ANSI committee for inclusion in the standard C++ specification."
},{"id":"31",
"q":"Explain Stack unwinding. ",
"answer":"Stack unwinding is a process during exception handling when the destructor is called for all local objects between the place where the exception was thrown and where it is caught."
},{"id":"32",
"q":"How does code-bloating occur in C++?",
"answer":"Improper use of Inline functions and templates may lead to code bloating.\n\n- Multiple Inheritance may also lead to code bloating. "
},{"id":"33",
"q":"Define Constructors?",
"answer":"A constructor is a member function with the same name as its class. The constructor is invoked whenever an object of its associated class is created.It is called constructor because it constructs the values of data members of the class. "
},{"id":"34",
"q":"What is a class?",
"answer":"A class is a collection of objects."
},{"id":"35",
"q":"What are the few advantages of Inline function?",
"answer":"It offers an improved macro facility.By using the inline functions, the user can split a large function with many nested modules of statement blocks into many small inline functions."
},{"id":"36",
"q":"What is copy constructor?",
"answer":"Copy constructor is a constructor function with the same name as the class and used to make deep copy of objects."
},{"id":"37",
"q":" What is default constructor?",
"answer":"A default constructor is a constructor that either has no parameters, or if it has parameters, all the parameters have default values. "
},{"id":"38",
"q":"What is a scope resolution operator?",
"answer":"The scope resolution operator permits a program to reference an identifier in the global scope that has been hidden by another identifier with the same name in the local scope."
},{"id":"39",
"q":"What is the difference between Object and Instance?",
"answer":"An instance of a user-defined type is called an object. We can instantiate many objects from one class.\n\nAn object is an instance of a class."
},{"id":"40",
"q":"What is multiple inheritance?",
"answer":"A class can inherit properties from more than one class which is known as multiple inheritance."
},{"id":"41",
"q":"What do you mean by reference variable in c++? ",
"answer":"A reference variable provides an alias to a previously defined variable.\n\nData -type & reference-name = variable name"
},{"id":"42",
"q":"What is iterator class?",
"answer":"Iterator class provides an access to the class which are inside the containers(it holds a group of objects in an organized way).\n\nThe containers include the data structure, class and abstract data type."
},{"id":"43",
"q":"What are Smart pointers?·",
"answer":" Smart pointers are almost similar to pointers with additional features such as automatic destruction of a variable when it becomes out of scope and the throwing of exceptions that ensures the proper destruction of the dynamically allocated objects."
},{"id":"44",
"q":"Explain function template?",
"answer":" Function template provides a means to write generic functions for different data types such as integer, long, float or user defined objects."
},{"id":"45",
"q":"Explain class template?",
"answer":"Class template provides a means to write a generic class for different types so that a class can have members based on generic types that do not need to be defined at the moment of creating the class or whose members use these generic types."
},{"id":"46",
"q":"What are the advantages of inheritance?",
"answer":"Code reusability Saves time in program development."
},{"id":"47",
"q":"What is a dynamic constructor?",
"answer":"The constructor can also be used to allocate memory while creating objects.\n\nAllocation of memory to objects at the time of their construction is known as dynamic construction of objects.\n\nThe memory is allocated with the help of the new operator."
},{"id":"48",
"q":"What is the use of ‘using’ declaration? ",
"answer":"A using declaration makes it possible to use a name from a namespace."
},{"id":"49",
"q":" What is a scope resolution operator? ",
"answer":"A scope resolution operator (::), can be used to define the member functions of a class outside the class. "
},{"id":"50",
"q":" What do you mean by pure virtual functions? ",
"answer":"A pure virtual member function is a member function that the base class forces derived classes to provide. Any class containing any pure virtual function cannot be used to create object of its own type."
},{"id":"51",
"q":"What is a conversion constructor?Where we will define the session state type? ",
"answer":"A converting constructor is a single-parameter constructor that is declared without the function specifier explicit.\n\nThe compiler uses converting constructors to convert objects from the type of the first parameter to the type of the converting constructor’s class. "
},
{"id":"52",
"q":"What is Associative container?",
"answer":" Associative containers are designed to support direct access to elements using keys. They are not sequential. There are four types of associatives containers :\n\nSet\n\nMultiset\n\nMap\n\nMultimap "
},{"id":"53",
"q":" What is an iterator? ",
"answer":"Iterators are like pointers. They are used to access the elements of containers thus providing a link between algorithms and containers. Iterators are defined for specific containers and used as arguments to algorithms."
},{"id":"54",
"q":"What is this pointer?",
"answer":"It is a pointer that points to the current object. This can be used to access the members of the current object with the help of the arrow operator."
},{"id":"55",
"q":"Name some pure object oriented languages? ",
"answer":"Smalltalk\n\nJava\n\nEiffel\n\nSather"
},{"id":"56",
"q":"What is encapsulation?",
"answer":"Encapsulation (or information hiding) is the process of combining data and functions into a single unit called class."
},{"id":"57",
"q":"What is problem with Runtime type identification? ",
"answer":"The run time type identification comes at a cost of performance penalty. Compiler maintains the class."
},{"id":"58",
"q":"What is conversion operator?",
"answer":"You can define a member function of a class, called a conversion function, that converts from the type of its class to another specified type."
},{"id":"59",
"q":"What do you mean by implicit conversion?",
"answer":"Whenever data types are mixed in an expression then c++ performs the conversion automatically.\n\nHere smaller type is converted to wider type.\n\nExample : in case of integer and float integer is converted into float type."
},{"id":"60",
"q":"What are virtual functions? ",
"answer":"The virtual fuctions must be members of some class.\n\nThey cannot be static members.\n\nThey are accessed by using object pointers.\n\nA virtual function can be a friend of another class."
},{"id":"61",
"q":" What is a friend?",
"answer":"Friends can be either functions or other classes. The class grants friends unlimited access privileges."
},
{"id":"62",
"q":" What is stack unwinding?",
"answer":"Stack unwinding is a process in which a destructor is invoked in a particular program for destroying all the local objects in the stack between throwing and catching of an exception."
},
{"id":"63",
"q":" What is the difference between a copy constructor and an overloaded assignment operator? ",
"answer":"A copy constructor constructs a new object by using the content of the argument object. An overloaded assignment operator assigns the contents of an existing object to another existing object of the same class."
},
{"id":"64",
"q":"Is it possible to get the source code back from binary file?",
"answer":"Technically it is possible to generate the source code from binary. It is called reverse engineering. There are lot of reverse engineering tools available. But, in actual case most of them will not re generate the exact source code back because many information will be lost due to compiler optimization and other interpretations."
},
{"id":"65",
"q":"What is virtual destructors? Why they are used?",
"answer":"Virtual destructors are used for the same purpose as virtual functions. When you remove an object of subclass, which is referenced by a parent class pointer, only destructor of base class will get executed. But if the destructor is defined using virtual keyword, both the destructors [ of parent and sub class ] will get invoked."
},
{"id":"66",
"q":"What is meant by reference variable in C++?",
"answer":"In C++, reference variable allows you create an alias (second name) for an already existing variable. A reference variable can be used to access (read/write) the original data. That means, both the variable and reference variable are attached to same memory location. In effect, if you change the value of a variable using reference variable, both will get changed (because both are attached to same memory location)."
},
{"id":"67",
"q":"What do you mean by a public member?",
"answer":"A member declared as public is a public member.\n\nIt can be accessed freely in a program."
},
{"id":"68",
"q":"How the keyword struct is different from the keyword class in C++?",
"answer":"In C++, a class is similar to a struct with the exception that, by default, all the members of a class are private; while the members of a struct are public. Encapsulation is not supported by structures but supported by classes."
},
{"id":"69",
"q":"What is reference?",
"answer":"Reference is a name that acts as an alias, or alternative name, for a previously defined variable or an object."
},
{"id":"70",
"q":"What is the use of storage class specifiers?",
"answer":"A storage class specifier is used to refine the declaration of a variable, a function, and parameters. The following are storage class specifiers :\n\nauto\n\nregister\n\nstatic\n\nextern"
},
{"id":"71",
"q":"Can destructor be private?",
"answer":"Yes destructors can be private. But according it is not advisable to have destructors to be private."
},
{"id":"72",
"q":"What is strstream?",
"answer":"stringstream provides an interface to manipulate strings as if they were input/output streams.\n\n‹ strstream› to define several classes that support iostreams operations on sequences stored in an allocated array of char object."
},
{"id":"73",
"q":"What do you mean by a template?",
"answer":"Templates enable creation of generic functions that admit any data type as parameters and return value without having to overload the function with all the possible data types unless they fulfill the functionality of a macro.\n\n- Its prototype can be one of the following : template function_declaration; template function_declaration;\n\n- The only difference between both prototypes is the use of keyword class or typename. It's use is indistinct since both expressions have exactly the same meaning and behave exactly the same way."
},
{"id":"74",
"q":"Difference between a copy constructor and an assignment operator.",
"answer":"- A copy constructor is used to declare and initialize an object from another object.\n\n- For Example : integer I2(I1);\n\n- An assignment operator doesnot invoke the copy constructor. It simply assigns the values of an object to another, member by member."
},
{"id":"75",
"q":"What are the various operations performed on stack?",
"answer":"Various operations which can be performed on stack are as follows :\n\ncreatempty() : It creates an empty stack by initializing TOP to -1.\n\nIsempty() : It determines whether stack is empty or not. It returns value 1 if stack is empty otherwise return 0.\n\nPush() : Adding a new element at the top of the stack is called Push.\n\nPop() : Removing an element from the top of the stack is called Pop."
}
]
}