InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 51. |
Which of the following is the correct difference between cin and scanf()?(a) both are the same(b) cin is a stream object whereas scanf() is a function(c) scanf() is a stream object whereas cin is a function(d) cin is used for printing whereas scanf() is used for reading inputI had been asked this question in class test.Question is taken from C++ Concepts in portion Basics Concepts of C++ of C++ |
|
Answer» Right choice is (b) cin is a stream object whereas scanf() is a FUNCTION |
|
| 52. |
Which of the following is not a type of inheritance?(a) Multiple(b) Multilevel(c) Distributive(d) HierarchicalThe question was asked by my school principal while I was bunking the class.This key question is from OOPs Concept topic in division Basics Concepts of C++ of C++ |
|
Answer» CORRECT answer is (c) DISTRIBUTIVE To explain I WOULD say: Distributive is not a type of inheritance WHEREAS others are a type of inheritance having their own meaning. |
|
| 53. |
Out of the following, which is not a member of the class?(a) Static function(b) Friend function(c) Constant function(d) Virtual functionThe question was asked at a job interview.This key question is from OOPs Concept in section Basics Concepts of C++ of C++ |
|
Answer» Right ANSWER is (b) Friend FUNCTION |
|
| 54. |
Which members are inherited but are not accessible in any case?(a) Private(b) Public(c) Protected(d) Both private and protectedI got this question in an online quiz.The doubt is from OOPs Concept in portion Basics Concepts of C++ of C++ |
|
Answer» Correct option is (a) PRIVATE |
|
| 55. |
Which of the following provides a programmer with the facility of using object of a class inside other classes?(a) Inheritance(b) Composition(c) Abstraction(d) EncapsulationI got this question by my school teacher while I was bunking the class.Enquiry is from OOPs Concept in division Basics Concepts of C++ of C++ |
|
Answer» The CORRECT answer is (B) Composition |
|
| 56. |
Wrapping data and its related functionality into a single entity is known as _____________(a) Abstraction(b) Encapsulation(c) Polymorphism(d) ModularityI have been asked this question in unit test.Enquiry is from OOPs Concept in section Basics Concepts of C++ of C++ |
|
Answer» Right option is (b) ENCAPSULATION |
|
| 57. |
Which of the following is called insertion/put to operator?(a) (c) >(d) |
|
Answer» The correct option is (a) << |
|
| 58. |
What happens if a class does not have a name?(a) It will not have a constructor(b) It will not have a destructor(c) It is not allowed(d) It will neither have a constructor or destructorThis question was posed to me in an internship interview.My enquiry is from OOPs Concept in section Basics Concepts of C++ of C++ |
|
Answer» RIGHT choice is (b) It will not have a DESTRUCTOR Explanation: A CLASS without a name will not have a destructor. The OBJECT is made so constructor is REQUIRED but the destructor is not. Check the code below: |
|
| 59. |
Which of the following is called extraction/get from operator?(a) (c) >(d) |
|
Answer» The CORRECT ANSWER is (b) >> |
|
| 60. |
Which of the following is called address operator?(a) *(b) &(c) _(d) %I have been asked this question in a national level competition.Origin of the question is Basics in section Basics Concepts of C++ of C++ |
|
Answer» The correct option is (B) & |
|
| 61. |
What is dynamic binding?(a) The process of linking the actual code with a procedural call during run-time(b) The process of linking the actual code with a procedural call during compile-time(c) The process of linking the actual code with a procedural call at any-time(d) All of the mentionedI had been asked this question by my school principal while I was bunking the class.This key question is from C++ Concepts in chapter Basics Concepts of C++ of C++ |
|
Answer» Correct choice is (a) The process of linking the actual CODE with a procedural CALL during run-time |
|
| 62. |
C++ is ______________(a) procedural programming language(b) object oriented programming language(c) functional programming language(d) both procedural and object oriented programming languageThe question was asked in my homework.Asked question is from OOPs Concept topic in division Basics Concepts of C++ of C++ |
|
Answer» Right choice is (d) both procedural and object oriented PROGRAMMING language |
|
| 63. |
Which of the following is the correct syntax of including a user defined header files in C++?(a) #include (b) #include (c) #include “userdefined”(d) #include [userdefined]I had been asked this question by my school teacher while I was bunking the class.My question is taken from Basics in portion Basics Concepts of C++ of C++ |
|
Answer» The correct CHOICE is (c) #INCLUDE “userdefined” |
|
| 64. |
Which of the following is an exit-controlled loop?(a) for(b) while(c) do-while(d) all of the mentionedThe question was asked during an interview for a job.Asked question is from C++ Concepts in portion Basics Concepts of C++ of C++ |
|
Answer» RIGHT option is (C) do-while The explanation: do-while is called exit controlled loop because in do-while termination condition is checked when we have executed the BODY of the loop i.e. we are EXITING the body and then checking the condition, THEREFORE, it is called exit controlled loop. |
|
| 65. |
Which of the following is C++ equivalent for printf()?(a) cin(b) cout(c) print(d) inputI had been asked this question during an internship interview.The origin of the question is C++ Concepts in chapter Basics Concepts of C++ of C++ |
|
Answer» The correct option is (b) COUT |
|
| 66. |
How access specifiers in Class helps in Abstraction?(a) They does not helps in any way(b) They allows us to show only required things to outer world(c) They help in keeping things together(d) Abstraction concept is not used in classesI got this question during a job interview.The doubt is from OOPs Concept in chapter Basics Concepts of C++ of C++ |
|
Answer» CORRECT answer is (b) They allows us to SHOW only required things to outer world To explain: Abstraction is the concept of hiding things from the outer world and showing only the required things to the world, which is where ACCESS specifiers private, PROTECTED and PUBLIC helps in keeping our knowledge hidden from the world. |
|
| 67. |
Which of the following cannot be a friend?(a) Function(b) Class(c) Object(d) Operator functionI had been asked this question in final exam.Question is taken from OOPs Concept topic in division Basics Concepts of C++ of C++ |
|
Answer» Correct ANSWER is (c) Object |
|
| 68. |
Which of the following type is provided by C++ but not C?(a) int(b) bool(c) float(d) doubleI had been asked this question in semester exam.The question is from C++ vs C in chapter Basics Concepts of C++ of C++ |
|
Answer» The CORRECT option is (b) bool |
|
| 69. |
Which of the following is correct?(a) Base class pointer object cannot point to a derived class object(b) Derived class pointer object cannot point to a base class object(c) A derived class cannot have pointer objects(d) A base class cannot have pointer objectsThe question was asked in class test.I want to ask this question from OOPs Concept topic in division Basics Concepts of C++ of C++ |
|
Answer» Right OPTION is (b) Derived class pointer object cannot point to a base class object |
|
| 70. |
Which function is used to read a single character from the console in C++?(a) cin.get(ch)(b) getline(ch)(c) read(ch)(d) scanf(ch)I have been asked this question in an internship interview.This key question is from Basics topic in section Basics Concepts of C++ of C++ |
|
Answer» The correct answer is (a) cin.get(CH) |
|
| 71. |
What are the formal parameters in C++?(a) Parameters with which functions are called(b) Parameters which are used in the definition of the function(c) Variables other than passed parameters in a function(d) Variables that are never used in the functionI have been asked this question during an interview.The above asked question is from Basics in section Basics Concepts of C++ of C++ |
|
Answer» Right option is (b) Parameters which are USED in the definition of the function |
|