• +91 9971497814
  • info@interviewmaterial.com

Computer Interview Questions Answers

CPlusPlus Interview Questions Answers

Question - 21 : - Name 7 layers of the OSI Reference Model?

Answer - 21 : - -Application layer -Presentation layer -Session layer -Transport layer -Network layer -Data Link layer -Physical layer

Question - 22 : - Suppose a 3-bit sequence number is used in the selective-reject ARQ, what is the maximum number of frames that could be transmitted at a time?

Answer - 22 : - If a 3-bit sequence number is used, then it could distinguish 8 different frames. Since the number of frames that could be transmitted at a time is no greater half the numner of frames that could be distinguished by the sequence number, so at most 4 frames can be transmitted at a time.

Question - 23 : - Is it necessary to already know another programming language before learning C++?

Answer - 23 : - Not necessarily. C++ is a simple and clear language in its expressions. It is true that a piece of code written with C++ may be seen by a stranger of programming a bit more cryptic than some other languages due to the intensive use of special characters ({}[]*&!|...), but once one knows the meaning of such characters it can be even more schematic and clear than other languages that rely more on English words. Also, the simplification of the input/output interface of C++ in comparison to C and the incorporation of the standard template library in the language, makes the communication and manipulation of data in a program written in C++ as simple as in other languages, without losing the power it offers.

Question - 24 : - What is class invariant?

Answer - 24 : - A class invariant is a condition that defines all valid states for an object. It is a logical condition to ensure the correct working of a class. Class invariants must hold when an object is created, and they must be preserved under all operations of the class. In particular all class invariants are both preconditions and post-conditions for all operations or member functions of the class.

Question - 25 : - What is a conversion constructor?

Answer - 25 : - A constructor that accepts one argument of a different type.

Question - 26 : - What is C++?

Answer - 26 : - C++ is a programming language. It literally means "increased C", reflecting its nature as an evolution of the C language.

Question - 27 : - What is the difference between a copy constructor and an overloaded assignment operator?

Answer - 27 : - 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.

Question - 28 : - What is encapsulation?

Answer - 28 : - Packaging an object’s variables within its methods is called encapsulation.

Question - 29 : - What is a scope resolution operator?

Answer - 29 : - A scope resolution operator (::), can be used to define the member functions of a class outside the class.

Question - 30 : - What is an orthogonal base class?

Answer - 30 : - If two base classes have no overlapping methods or data they are said to be independent of, or orthogonal to each other. Orthogonal in the sense means that two classes operate in different dimensions and do not interfere with each other in any way. The same derived class may inherit such classes with no difficulty.

Computer Contributors

krishan
Rajeev Katiyar
Yes Baroda

Share your email for latest updates

Name:
Email:

Our partners