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.
| 1. |
Which among the following is the most abstract form of class?(a) Cars(b) BMW cars(c) Big cars(d) Small carsI had been asked this question in an interview.My question is based upon Class Use topic in division Classes of Object Oriented Programming |
|
Answer» CORRECT option is (a) Cars The explanation: The most abstract class is class Cars. The class Cars is the most general FORM of all other cars. If it is a BRAND of car, it comes under car. If it is the TYPE of car then ALSO it comes under Cars. |
|
| 2. |
Why do classes use mutator methods?(a) Allows client to modify the program(b) Allows client to modify/write the private members(c) Allows servers to access all the private data(d) Allows servers to access only protected membersThis question was posed to me during an interview.My question is from Class Use in division Classes of Object Oriented Programming |
|
Answer» Correct OPTION is (b) Allows CLIENT to modify/write the private members |
|
| 3. |
Why do classes use accessor methods?(a) To make public data accessible to client(b) To make public data private to client(c) To make private data public for whole program(d) To make private data accessible to the clientI have been asked this question during an online interview.Enquiry is from Class Use topic in division Classes of Object Oriented Programming |
|
Answer» Correct answer is (d) To make private data accessible to the client |
|
| 4. |
Why do we use user defined classes?(a) To design a user intended code(b) To model real world objects(c) To design the interfaces(d) To model the functionsI have been asked this question in examination.Query is from Class Use topic in chapter Classes of Object Oriented Programming |
|
Answer» Correct choice is (B) To model real world objects |
|
| 5. |
Which feature is exhibited by the inbuilt classes?(a) Code reusability(b) Code efficiency(c) Code readability(d) Code reusability, efficiency and readabilityI have been asked this question during a job interview.My enquiry is from Class Use in portion Classes of Object Oriented Programming |
|
Answer» Correct OPTION is (d) Code reusability, efficiency and readability |
|
| 6. |
What is the use of inbuilt classes?(a) Provide predefined data(b) Provide predefined functions(c) Provide predefined data and functions(d) Provide predeclared data to be overriddenThe question was asked during an interview.Query is from Class Use topic in division Classes of Object Oriented Programming |
|
Answer» Right choice is (c) PROVIDE predefined data and FUNCTIONS |
|
| 7. |
In which case the classes can be used to make the more efficient program?(a) To define a function that is called frequently in a program(b) To structure data that is most similar(c) To group the most similar data and operations(d) To define a blueprint that shows memory location of dataThis question was addressed to me in an online interview.The query is from Class Use topic in division Classes of Object Oriented Programming |
|
Answer» Right OPTION is (c) To group the most similar data and OPERATIONS |
|
| 8. |
Class is _____________ of an object.(a) Basic function definition(b) Detailed description with values(c) Blueprint(d) Set of constant valuesThis question was posed to me in an online quiz.I'm obligated to ask this question of Class Use topic in section Classes of Object Oriented Programming |
|
Answer» The correct choice is (c) Blueprint |
|
| 9. |
Which among the following is a feature of class?(a) Object orientation(b) Procedure orientation(c) Both object and procedure orientation(d) Neither object nor procedure orientationI have been asked this question in semester exam.I need to ask this question from Class Use topic in section Classes of Object Oriented Programming |
|
Answer» Right choice is (a) OBJECT orientation |
|
| 10. |
Which among the following is an advantage of using classes over structures of C?(a) Functions are restricted(b) Functions can’t be defined(c) Functions can also be encapsulated(d) Functions can have more securityThe question was posed to me in an interview for internship.My question is taken from Class Use in chapter Classes of Object Oriented Programming |
|
Answer» The correct option is (c) Functions can also be encapsulated |
|
| 11. |
Which class represents the most abstracted information?(a) Nested(b) Derived(c) Enclosed(d) BaseI have been asked this question by my school teacher while I was bunking the class.My question is based upon Class Use topic in division Classes of Object Oriented Programming |
|
Answer» The CORRECT CHOICE is (d) Base |
|
| 12. |
If a database have to be maintained using OOP, to store the details of each employee in a company, which would be the best choice among the following?(a) Define a class to store details of each employee(b) Define a structure to store details of each employee(c) Define separate variable for each detail(d) Define a generic type to store string and number detailsI have been asked this question in class test.The above asked question is from Class Use in chapter Classes of Object Oriented Programming |
|
Answer» Right choice is (a) Define a class to store details of each employee |
|
| 13. |
If a class have two data members and two functions to add those two numbers and to subtract them, which among the following is most efficient if the programmer wants to implement multiplication too?(a) Define a public function which multiplies two numbers(b) Define a public function that returns values of two data members(c) Define a private function which multiplies two numbers(d) Define a private function that returns values of two data membersI have been asked this question in a national level competition.The question is from Class Use in section Classes of Object Oriented Programming |
|
Answer» The correct option is (b) Define a public function that RETURNS values of two data MEMBERS |
|
| 14. |
To group all the brands of cars, what should be used?(a) Class(b) Structure(c) Function(d) ObjectThis question was addressed to me in an interview.Question is taken from Class Use in chapter Classes of Object Oriented Programming |
|
Answer» The CORRECT choice is (a) Class |
|
| 15. |
Which among the following is the main characteristic of class?(a) Inheritance(b) Encapsulation(c) Polymorphism(d) Object creationThe question was posed to me in a national level competition.My question is taken from Class Use topic in chapter Classes of Object Oriented Programming |
|
Answer» Correct choice is (b) Encapsulation |
|
| 16. |
Deriving a class in such a way that that the base class members are not available for further inheritance is known as ___________________(a) Public inheritance(b) Protected inheritance(c) Protected or private inheritance(d) Private inheritanceI got this question in an online quiz.My doubt stems from Derived Class in portion Classes of Object Oriented Programming |
|
Answer» The correct option is (d) PRIVATE INHERITANCE |
|
| 17. |
Which feature is not related to the derived classes among the following?(a) Inheritance(b) Encapsulation(c) Run time memory management(d) Compile time function referencesThe question was asked by my college director while I was bunking the class.I need to ask this question from Derived Class topic in chapter Classes of Object Oriented Programming |
|
Answer» CORRECT option is (c) Run TIME memory MANAGEMENT Easy EXPLANATION - The memory management is the feature that is not necessary for DERIVED classes that will be a part of whole program. The functions references must be resolved for their proper use if inheritance is used. |
|
| 18. |
The members of a derived class can never be derived.(a) True(b) FalseThis question was posed to me in an interview for internship.My enquiry is from Derived Class topic in section Classes of Object Oriented Programming |
|
Answer» RIGHT option is (b) False Easiest explanation - This is not true that the members of a derived class can’t be derived. All the classes are considered to be a normal class when used for derivation. The members can be derived with RESPECT to their ACCESS SPECIFIERS. |
|
| 19. |
How many classes can be derived from a derived class?(a) Only 1(b) At most 1(c) At least 1(d) As many as requiredThis question was posed to me in unit test.This interesting question is from Derived Class in chapter Classes of Object Oriented Programming |
|
Answer» Correct option is (d) As many as required |
|
| 20. |
If base class is an abstract class then derived class ______________ the undefined functions.(a) Must define(b) Must become another abstract class or define(c) Must become parent class for(d) Must implement 2 definitions ofI have been asked this question during an interview.This intriguing question originated from Derived Class in portion Classes of Object Oriented Programming |
|
Answer» Correct choice is (B) Must become another ABSTRACT CLASS or define |
|
| 21. |
If class A is derived from another derived class B which is derived from class C, which class will have maximum level of abstraction?(a) Class A(b) Class B(c) Class C(d) All have the same level of abstractionThe question was asked during an interview.Origin of the question is Derived Class topic in portion Classes of Object Oriented Programming |
|
Answer» Right answer is (c) CLASS C |
|
| 22. |
Derived class is also known as ______________ class.(a) Subclass(b) Small class(c) Big class(d) Noticeable classI have been asked this question in an online interview.My question is based upon Derived Class topic in chapter Classes of Object Oriented Programming |
|
Answer» CORRECT answer is (a) Subclass Easiest explanation - It is just another NAME given to the derived CLASSES. This is used while denoting all the derived classes subsequent to a superclass. |
|
| 23. |
If a class is being derived using more than two base classes, which inheritance will be used?(a) Single(b) Multi-level(c) Hierarchical(d) MultipleI had been asked this question in homework.Question is from Derived Class in chapter Classes of Object Oriented Programming |
|
Answer» CORRECT option is (d) Multiple To explain: The statement given is the definition of multiple INHERITANCE with respect to the derived class. The concept can be ILLUSTRATED with many other samples but the main ASPECTS are base class and derived class only. |
|
| 24. |
Which among the following is correct?(a) Friend function of derived class can access non-private members of base class(b) Friend function of base class can access derived class members(c) Friend function of derived class can access members of only derived class(d) Friend function can access private members of base class of a derived classThe question was asked in a national level competition.Origin of the question is Derived Class topic in portion Classes of Object Oriented Programming |
|
Answer» The correct option is (a) Friend function of derived class can access non-private members of base class |
|
| 25. |
How many derived class can a single base class have?(a) 1(b) 2(c) 3(d) As many are requiredI had been asked this question in semester exam.My question is from Derived Class topic in portion Classes of Object Oriented Programming |
|
Answer» The correct option is (d) As many are required |
|
| 26. |
How many types of inheritance are supported in C++ for deriving a class?(a) 1(b) 2(c) 3(d) 4The question was asked in a national level competition.The doubt is from Derived Class in chapter Classes of Object Oriented Programming |
|
Answer» The correct choice is (c) 3 |
|
| 27. |
Which members can never be accessed in derived class from the base class?(a) Private(b) Protected(c) Public(d) All except privateI have been asked this question in semester exam.This interesting question is from Derived Class in chapter Classes of Object Oriented Programming |
|
Answer» Right choice is (d) All except PRIVATE |
|
| 28. |
If there is a derived class in a program, how many classes must be in that program?(a) 1(b) 2(c) 3(d) 4I have been asked this question by my school teacher while I was bunking the class.The doubt is from Derived Class in portion Classes of Object Oriented Programming |
|
Answer» Right CHOICE is (b) 2 |
|
| 29. |
Which among the following is inherited by a derived class from base class?(a) Data members only(b) Member functions only(c) All the members except private members(d) All the members of base classI have been asked this question during an online interview.Enquiry is from Derived Class in portion Classes of Object Oriented Programming |
|
Answer» Correct choice is (C) All the members except private members |
|
| 30. |
Which among the following is best definition of a derived class?(a) A child class(b) A class which inherits one or more classes(c) A class with keyword derived(d) A class with more than one constructorI have been asked this question in semester exam.Enquiry is from Derived Class topic in chapter Classes of Object Oriented Programming |
|
Answer» Correct answer is (B) A CLASS which INHERITS one or more classes |
|
| 31. |
If a base class is added with a few new members, its subclass must also be modified.(a) True(b) FalseI have been asked this question during an online exam.My question is based upon Base Class in section Classes of Object Oriented Programming |
|
Answer» The correct CHOICE is (b) False |
|
| 32. |
How many base classes can a single derived class have in C++?(a) 1(b) 2(c) 3(d) As many as requiredI had been asked this question in an international level competition.The above asked question is from Base Class in division Classes of Object Oriented Programming |
|
Answer» Correct option is (d) As many as required |
|
| 33. |
If a base class is inherited from another class and then one class derives it, which inheritance is shown?(a) Multiple(b) Single(c) Hierarchical(d) Multi-levelI have been asked this question by my college professor while I was bunking the class.Origin of the question is Base Class in chapter Classes of Object Oriented Programming |
|
Answer» The correct CHOICE is (d) Multi-level |
|
| 34. |
Can we call methods of base class using the constructor of the derived class?(a) Yes, always(b) Yes, but not always(c) No, never(d) No, but we can call in some casesI had been asked this question during an internship interview.My doubt stems from Base Class in chapter Classes of Object Oriented Programming |
|
Answer» The correct option is (a) Yes, always |
|
| 35. |
Always the base class constructors are called ___________ constructor of derived class.(a) Before(b) After(c) Along(d) According to priority ofI had been asked this question in an interview for internship.The doubt is from Base Class topic in portion Classes of Object Oriented Programming |
|
Answer» Correct choice is (a) Before |
|
| 36. |
Base class have ________________ of abstraction.(a) Higher degree(b) Lower degree(c) Intermediate(d) Minimum degreeI had been asked this question in an international level competition.I'm obligated to ask this question of Base Class in portion Classes of Object Oriented Programming |
|
Answer» CORRECT choice is (b) LOWER degree The EXPLANATION is: A base class will have LESSER information as compared to those of derived classes. Since derived classes inherit the base class properties and then add on their own features, they elaborate more hence have lower degree of abstraction. |
|
| 37. |
If a class is enclosing more than one class, than it can be called as base class of those classes.(a) True(b) FalseThis question was addressed to me in quiz.My enquiry is from Base Class topic in portion Classes of Object Oriented Programming |
|
Answer» Right OPTION is (B) False |
|
| 38. |
Which type of members can’t be accessed in derived classes of a base class?(a) Protected(b) Private(c) Public(d) All can be accessedI had been asked this question at a job interview.I'd like to ask this question from Base Class in section Classes of Object Oriented Programming |
|
Answer» Right answer is (B) Private |
|
| 39. |
Which among the following must be in a base class?(a) Data members(b) Member functions(c) Access specifiers(d) NothingI got this question during an internship interview.Asked question is from Base Class in chapter Classes of Object Oriented Programming |
|
Answer» Right ANSWER is (d) Nothing |
|
| 40. |
If a base class is being derived by two other classes, which inheritance will that be called?(a) Single(b) Multiple(c) Multi-level(d) HierarchicalI had been asked this question during an online exam.I would like to ask this question from Base Class topic in section Classes of Object Oriented Programming |
|
Answer» The correct answer is (d) Hierarchical |
|
| 41. |
How to make a derived class a base class?(a) Change name of the class(b) Use keyword base(c) Make a class derive from it(d) Can’t be doneThe question was asked in exam.The origin of the question is Base Class topic in division Classes of Object Oriented Programming |
|
Answer» Right option is (c) Make a class DERIVE from it |
|
| 42. |
How many base classes can a single class inherit in java?(a) 1(b) 2(c) 3(d) As many as requiredThis question was addressed to me during an online exam.The origin of the question is Base Class in division Classes of Object Oriented Programming |
|
Answer» Right option is (a) 1 |
|
| 43. |
An abstract class is always a __________ class.(a) Base(b) Derived(c) Template(d) NestedI got this question during an interview.I'd like to ask this question from Base Class topic in chapter Classes of Object Oriented Programming |
|
Answer» Right choice is (a) Base |
|
| 44. |
A base class is also known as _____________ class.(a) Basic(b) Inherited(c) Super(d) SubThis question was addressed to me by my college professor while I was bunking the class.My question is from Base Class in section Classes of Object Oriented Programming |
|
Answer» Right option is (C) Super |
|
| 45. |
Which is most appropriate definition of a base class?(a) It is parent of any of its derived class(b) It is child of one of the parent class(c) It is most basic class of whole program(d) It is class with maximum number of membersI got this question in an international level competition.I need to ask this question from Base Class in section Classes of Object Oriented Programming |
|
Answer» CORRECT ANSWER is (a) It is PARENT of any of its derived class The explanation: A class which is parent of another class, or from which other classes can be derived, is known as a base class. It is mandatory that a class MUST have at least ONE derived class to be called as a base class. |
|
| 46. |
Template classes must have at least one static member.(a) True(b) FalseThe question was posed to me during an internship interview.My question is based upon Template Class in division Classes of Object Oriented Programming |
|
Answer» Right option is (b) False |
|
| 47. |
How many generic types can be given inside a single template class?(a) Only 1(b) Only 3(c) Only 7(d) As many as requiredThe question was posed to me during an online exam.My enquiry is from Template Class topic in section Classes of Object Oriented Programming |
|
Answer» Right OPTION is (d) As MANY as required |
|
| 48. |
What are the two specializations of I/O template classes in C++?(a) 16-bit character and wide characters(b) 8-bit character and wide characters(c) 32-bit character and locale characters(d) 64-bit characters and locale charactersI had been asked this question in unit test.My doubt stems from Template Class topic in division Classes of Object Oriented Programming |
|
Answer» Correct CHOICE is (b) 8-bit CHARACTER and wide characters |
|
| 49. |
A template class defines the form of a class _____________________ it will operate.(a) With full specification of the data on which(b) With full specification of the functions on which(c) Without full specification of the data on which(d) Without full specification of the functions on whichI had been asked this question in an internship interview.Question is taken from Template Class topic in portion Classes of Object Oriented Programming |
|
Answer» Right ANSWER is (c) WITHOUT full specification of the data on which |
|
| 50. |
Which is the most significant feature that arises by using template classes?(a) Code readability(b) Ease in coding(c) Code reusability(d) Modularity in codeI had been asked this question in an online quiz.The above asked question is from Template Class in section Classes of Object Oriented Programming |
|
Answer» Correct choice is (c) Code REUSABILITY |
|