Online Tutorials & Training Materials |
Register Login

C++ Interview Questions

C++ Interview FAQ's

1.What is C++?

C++ is a high level, general purpose, object oriented programming language. C++ is a compiler based programming language.

2.What is a compiler?

A compiler is a translator software that converts a high level programming language like C++ from programmer entered English instructions or source code to machine readable Binary code or machine code.

3.What is Object Oriented Programming?

Object Oriented Programming is a type of programming where the objects control the type of actions taken by the program in a class. Objects define the different attributes of the language.

4.What is class?

Class in programming is the blueprint that structures and specifies how that portion of the program shall work. Class defines the data type, while objects in the class define the actions taken. There may be as many objects inside a class as required.

5.What is Encapsulation?

Encapsulation is the mechanism of C++ where data and its associated operations are bound together to form a shell (class), that limits accessibility of the data to the outside world. It is also called Data Hiding and is an important advantage of C++ language.

6.What is Inheritance?

Inheritance is the process where the properties and attributes of existing classes are made available to other classes in a program without the need to specify the details of the classes again and again. The existing classes are called base classes, and the classes newly created from them are called derived classes.

7.What is Abstraction?

Abstraction is another feature of C++ where the internal working of the program is hidden and only the necessary details are made visible.

8.What are the types of Inheritance in C++?

  • Single Inheritance: Inheritance of one derived class from one base class.
  • Multiple Inheritance: Inheritance of one class from more than one base classes.
  • Multi level Inheritance: Inheritance of a class from another class which was further derived from another class.
  • Hierarchical Inheritance: Inheritance of more than one class from a single base class.
  • Hybrid Inheritance: Inheritance of classes using more than one inheritance type.

9.What is meant by storage class?

Storage class describes the scope, or lifetime of the symbols used in the program, like functions, variables, etc.

10.What are the types of storage classes used in C++?

Storage classes supported in C++ are static, register, extern, mutable, and auto.

11.What is a constructor?

A constructor is a member function of a class with the same name as the class name. The constructor function gets executed as soon as the object for that class is created.

12.What is a default constructor?

If the programmer does not specify a constructor, the compiler automatically provides a constructor for the class. If the programmer specifies a constructor function without any parameters, the compiler does not give a constructor. This is called a default constructor.

13.What is a destructor?

Destructor is the member function of a class with the same name as the class, with a tilde symbol (~) as prefix. Hence, it is a constructor with a ~ prefix. The destructor is executed when the object of the class ends its scope, or finishes its lifetime.

14.What is recursion?

Recursion is the phenomenon where a function calls itself in the program.

15.What is visibility mode of inheritance?

According to data hiding, data members of a class are not available outside unless one or more classes are inherited from it. Visibility mode determines which data members are available to the derived classes. There are three visibility modes of inheritance in C++: public, private, and protected.

16.What is public inheritance?

All data members declared under public in a class are available to the derived classes, and become public members of the derived classes.

17.What is private inheritance?

Data members declared under private in a class are not available to any function outside that class. If the inheritance mode is not declared in the program, it is defined by default as private.

18.What is protected inheritance?

Data members declared as protected in a class are available to functions in the directly derived class only, and they become protected members of the derived class.

19.What is a preprocessor?

Preprocessor is an instruction to the compiler to perform some tasks before actually starting compilation of the program.

20.What is a container class?

A Container Class is a class containing at least one member variable of another class type.

21.What is token?

A token can be a keyword, a constant, a symbol, string literal, or identifier. A C++ program is made up of different tokens.

22.What happens when a C++ program without a main () function is run?

A program without a main () function definition can be compiled, but it cannot be executed.

23.What is register storage specifier?

Variables declared under a register storage specifier are assigned CPU register memory for their storage. These variables require less time to be called and used by the functions. Hence, variables that are to be used repeatedly are declared under register storage specifier.

24.What is overloading?

Overloading is the phenomenon where more than one definition can be specified for some functions and objects within the same scope. They are then called function overriding, and object overloading respectively.

25.What is function overriding?

If the functions of a base class are defined again in the derived class, the phenomenon is called function overriding.

26.What are command line arguments?

Arguments or parameters sent to the main() function from the command line or console while the program is being executed is called command line arguments. All such arguments are sent as strings.

1836 results
  • Top 25 C# Interview Questions and Answers
    What is C# (Sharp)? n nC# is an object-oriented programming language that is both general-purpose and modern in its features. Developed by Microsoft, it was designed to be compatible with Common...
  • Posted in: Articles » » | By: vaibhav gupta | Date: 20 Nov 2018 1:20 pm | Comments (0)
  • WPF Interview Questions and Answers
    What is WPF? n nWindows Presentation Foundation or WPF is an engine developed by Microsoft using a GUI framework along with the .NET framework. It is used to for create, display, and manipulate...
  • Posted in: Articles » » | By: Romil Tripathi | Date: 10 Jan 2019 9:36 am | Comments (0)
  • Appium Interview Questions and Answers
    What is Appium testing? n nIt is an open source testing framework used for mobile apps. It is used to test the user interfaces of the mobile web, native and hybrid applications. These tests can be...
  • Posted in: Articles » » | By: Shalesh Singh | Date: 11 Feb 2019 1:34 pm | Comments (0)
  • Laravel Interview Questions and Answers
    What is Laravel? n nLaravel is a structure that allows a user to choose and create programs. Everything from giving a form to software and joining it with different application programs is covered by...
  • Posted in: Articles » » | By: rekha | Date: 15 Jan 2019 6:04 am | Comments (0)
  • Hive Interview Questions and Answers
    What is Hive? n nHive is a tool to perform ETL (extract, transform and load) and Data warehousing functions. It was developed as a sub-project of Hadoop Distributed File System (HDFS). Hive makes...
  • Posted in: Articles » » | By: vaibhav gupta | Date: 14 Feb 2019 6:43 am | Comments (0)
  • SASS Interview Questions and Answers
    What is sass? n nSass or Syntactically Awesome Style Sheets is a CSS extension with special features like variables, nested rules, mixins, inline imports, and other built-in functions that help to...
  • Posted in: Articles » » | By: Sugandh | Date: 10 Jan 2019 9:59 am | Comments (0)
  • Smartforms Interview Questions and Answers
    SAP ABAP Smartforms Interview FAQ n nQ) Define Smart form? n nForm Printing in the Internet Age n nSmart Forms was initially presented in SAP Basis Release 4.6C primarily as a tool for the creation...
  • Posted in: Interview Questions » ABAP » | By: rekha | Date: 29 Jun 2018 1:19 pm | Comments (6)
  • Reorganizations Interview Question and Answers
    nFAQ: Reorganizations 1. What is reorganization?The term reorganization refers to the reconstruction of objects in the database. A distinction is made between offline and online...
  • Posted in: Interview Questions » Oracle » | By: rekha | Date: 19 May 2018 4:27 am | Comments (0)
  • Oracle Interview Questions for Professionals
    Q1. You added a PHONE-NUMBER column of NUMBER data type to an existing EMPLOYEES table. The EMPLOYEES table already contains records of 100 employees. Now, you want to enter the phone numbers of each...
  • Posted in: Interview Questions » Oracle » | By: Shalesh Singh Visen | Date: 18 May 2018 11:44 am | Comments (0)
  • BDC Program Interview Question and Answer
    What is the function key values of BDC_OKCODE ie '/00' what this is for?How will we handle the errors in call transaction method? '/00' is generally the BDC_OKCODE for the ENTER...
  • Posted in: Tutorial » ABAP » | By: saketpratap | Date: 19 May 2018 3:33 pm | Comments (0)
  • SAP Controlling Interview Questions and Answers
    SAP Controlling FAQ CONTROLLINGControlling: Controlling provides you with information for management decision-making. If facilitates co-ordination, monitoring and optimization of all process in...
  • Posted in: Interview Questions » FICO (Financial Accounting & Controlling) » | By: saketpratap | Date: 18 May 2018 12:02 pm | Comments (0)
  • EXPORT_TOO_MUCH_DATA Dump Interview Questions and Answers
    EXPORT_TOO_MUCH_DATA FAQsQ-1) What is the cause of EXPORT_TOO_MUCH_DATA?Ans) The system issues the short dump EXPORT_TOO_MUCH_DATA happens when the total size of all data objects of an EXPORT...
  • Posted in: Interview Questions » ABAP » | By: vaibhav gupta | Date: 18 May 2018 11:31 pm | Comments (0)
  • Oracle TNS Name Interview Questions
    ORA-12154: TNS:could not resolve service namenR3trans or work processes terminate with the following errors:n  C  *** ERROR => OCI-call 'olog' failed: rc = 12154n  C  *** ERROR...
  • Posted in: Forum » Oracle » | By: rekha | Date: 19 May 2018 1:46 am | Comments (0)
  • Oracle Net Interview Questions and Answers
    Oracle Net FAQs1. What is Oracle Net or (Net8/SQL*Net V2)?Ans) Oracle Net Services (Oracle 9), Oracle Net (Oracle 8) or SQL*Net V2 (Oracle 7) are used for communication between an Oracle client (for...
  • Posted in: Interview Questions » Oracle » | By: rekha | Date: 19 May 2018 3:33 pm | Comments (0)
  • Oracle statspack Interview Question and Answer
    1. What is a statspack? n nStatspack is the abbreviation for statistics package. The statspack consists of a collection of SQL, PL/SQL and SQL*Plus scripts. The statspack helps you to collect, store...
  • Posted in: Interview Questions » Oracle » | By: rekha | Date: 18 May 2018 1:56 pm | Comments (0)
  • REPORT GENERATION Interview Questions and Answers
    FAQ of REPORT GENERATION REPORT GENERATION – FORMATTINGtThe alignment of a type ‘c’ field in a report is left Aligned.tIn the statement Write:/15(10) Ofal-lifnr. what do the...
  • Posted in: Interview Questions » ABAP » | By: rekha | Date: 20 May 2018 5:22 am | Comments (0)
  • Currency Translation Interview Questions and Answers
    Currency Translation FAQI. Persistence of the currency translation (Tables TCUR)1. How are the entries of the TCURF and TCURR tables related?The TCURR table contains only the exchange rates for the...
  • Posted in: Interview Questions » FICO (Financial Accounting & Controlling) » | By: rekha | Date: 18 May 2018 12:13 pm | Comments (5)
  • Oracle Performance Interview Question and Answer
    1. Can I use this FAQ to solve all Oracle performance problems? n nAnalyzing database performance is a complex subject. This FAQ does not claim to provide the solution for all performance problems...
  • Posted in: Interview Questions » Oracle » | By: rekha | Date: 19 May 2018 11:33 am | Comments (3)
  • Database Statistics Interview Questions and Answer
    Database statistics FAQ n n1. What are database statistics used for? n nThe Cost Based Optimizer (CBO) requires database statistics in order to use the most suitable access path (for example, index...
  • Posted in: Interview Questions » Oracle » | By: rekha | Date: 22 Aug 2018 10:57 am | Comments (0)
  • MaxDB Performance Interview Questions and Answers
    FAQ: MaxDB Performance 1. Where do I find more information about MaxDB Tuning?For information about MaxDB Tuning, see the SAP Developer Network (SDN) under the following...
  • Posted in: Interview Questions » BASIS » | By: rekha | Date: 18 May 2018 2:00 pm | Comments (1)