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 was the first purely object oriented programming language developed?(a) Java(b) C++(c) SmallTalk(d) KotlinI got this question in my homework.Question is taken from OOPs Basic Concepts topic in chapter OOPs Concept & Features of Object Oriented Programming |
|
Answer» RIGHT option is (c) SmallTalk The BEST I can explain: SmallTalk was the first PROGRAMMING language DEVELOPED which was purely object oriented. It was developed by Alan Kay. OOP concept came into the picture in 1970’s. |
|
| 2. |
Which of the following best defines a class?(a) Parent of an object(b) Instance of an object(c) Blueprint of an object(d) Scope of an objectThis question was addressed to me in an international level competition.The origin of the question is OOPs Basic Concepts topic in division OOPs Concept & Features of Object Oriented Programming |
|
Answer» RIGHT OPTION is (c) BLUEPRINT of an object For explanation: A class is Blueprint of an object which describes/ shows all the functions and data that are provided by an object of a specific class. It can’t be CALLED as parent or instance of an object. Class in general describes all the PROPERTIES of an object. |
|
| 3. |
What is the additional feature in classes that was not in structures?(a) Data members(b) Member functions(c) Static data allowed(d) Public access specifierI have been asked this question during an interview for a job.My doubt is from OOPs Basic Concepts in division OOPs Concept & Features of Object Oriented Programming |
|
Answer» Right OPTION is (B) Member functions |
|
| 4. |
Who invented OOP?(a) Alan Kay(b) Andrea Ferro(c) Dennis Ritchie(d) Adele GoldbergThe question was asked by my college professor while I was bunking the class.This is a very interesting question from OOPs Basic Concepts in section OOPs Concept & Features of Object Oriented Programming |
|
Answer» CORRECT answer is (a) ALAN Kay The best I can explain: Alan Kay invented OOP, Andrea FERRO was a part of SMALLTALK Development. Dennis invented C++ and Adele Goldberg was in team to DEVELOP SmallTalk but Alan actually had got rewarded for OOP. |
|
| 5. |
Which is not feature of OOP in general definitions?(a) Code reusability(b) Modularity(c) Duplicate/Redundant data(d) Efficient CodeThe question was posed to me in semester exam.I need to ask this question from OOPs Basic Concepts in division OOPs Concept & Features of Object Oriented Programming |
|
Answer» Right answer is (C) Duplicate/Redundant data |
|
| 6. |
Pure OOP can be implemented without using class in a program. (True or False)(a) True(b) FalseThe question was asked by my school teacher while I was bunking the class.My question comes from OOPs Basic Concepts topic in section OOPs Concept & Features of Object Oriented Programming |
|
Answer» Correct choice is (b) FALSE |
|
| 7. |
When OOP concept did first came into picture?(a) 1970’s(b) 1980’s(c) 1993(d) 1995I had been asked this question in my homework.This interesting question is from OOPs Basic Concepts topic in division OOPs Concept & Features of Object Oriented Programming |
|
Answer» Correct choice is (a) 1970’s |
|
| 8. |
Which Feature of OOP illustrated the code reusability?(a) Polymorphism(b) Abstraction(c) Encapsulation(d) InheritanceI got this question in an online quiz.This key question is from OOPs Basic Concepts in chapter OOPs Concept & Features of Object Oriented Programming |
|
Answer» Right answer is (d) Inheritance |
|
| 9. |
Which language does not support all 4 types of inheritance?(a) C++(b) Java(c) Kotlin(d) Small TalkThis question was addressed to me by my school principal while I was bunking the class.I want to ask this question from OOPs Basic Concepts in section OOPs Concept & Features of Object Oriented Programming |
|
Answer» Right option is (b) Java |
|
| 10. |
How many classes can be defined in a single program?(a) Only 1(b) Only 100(c) Only 999(d) As many as you wantI had been asked this question in quiz.Question is taken from OOPs Basic Concepts topic in portion OOPs Concept & Features of Object Oriented Programming |
|
Answer» Correct choice is (d) As MANY as you want |
|
| 11. |
Why Java is Partially OOP language?(a) It supports usual declaration of primitive data types(b) It doesn’t support all types of inheritance(c) It allows code to be written outside classes(d) It does not support pointersThe question was asked during an interview.The doubt is from OOPs Basic Concepts in portion OOPs Concept & Features of Object Oriented Programming |
|
Answer» Right option is (a) It supports usual DECLARATION of primitive data types |
|
| 12. |
Which concept of OOP is false for C++?(a) Code can be written without using classes(b) Code must contain at least one class(c) A class must have member functions(d) At least one object should be declared in codeThe question was asked in an online interview.This intriguing question comes from OOPs Basic Concepts in section OOPs Concept & Features of Object Oriented Programming |
|
Answer» CORRECT option is (b) Code must CONTAIN at least one class Easiest explanation - In C++, it’s not necessary to use classes, and hence CODES can be written without using OOP concept. Classes MAY or may not contain member functions, so it’s not a necessary condition in C++. And, an object can only be declared in a code if its class is defined/included via header file. |
|
| 13. |
Which header file is required in C++ to use OOP?(a) iostream.h(b) stdio.h(c) stdlib.h(d) OOP can be used without using any header fileThis question was posed to me in exam.This question is from OOPs Basic Concepts topic in division OOPs Concept & Features of Object Oriented Programming |
|
Answer» Right option is (d) OOP can be used without using any header FILE |
|
| 14. |
Which feature allows open recursion, among the following?(a) Use of this pointer(b) Use of pointers(c) Use of pass by value(d) Use of parameterized constructorI got this question by my school principal while I was bunking the class.My question is based upon OOPs Basic Concepts in division OOPs Concept & Features of Object Oriented Programming |
|
Answer» The CORRECT CHOICE is (a) Use of this pointer |
|
| 15. |
Which of the two features match each other?(a) Inheritance and Encapsulation(b) Encapsulation and Polymorphism(c) Encapsulation and Abstraction(d) Abstraction and PolymorphismI have been asked this question in an interview for internship.This intriguing question originated from OOPs Basic Concepts topic in section OOPs Concept & Features of Object Oriented Programming |
|
Answer» The CORRECT choice is (c) Encapsulation and Abstraction |
|
| 16. |
Which of the following is not type of class?(a) Abstract Class(b) Final Class(c) Start Class(d) String ClassI got this question during an interview for a job.My doubt stems from Classes topic in portion OOPs Concept & Features of Object Oriented Programming |
|
Answer» The correct option is (c) START Class |
|
| 17. |
Class is pass by _______(a) Value(b) Reference(c) Value or Reference, depending on program(d) CopyI had been asked this question by my school teacher while I was bunking the class.My doubt is from Classes in portion OOPs Concept & Features of Object Oriented Programming |
|
Answer» RIGHT CHOICE is (b) REFERENCE Explanation: Classes are PASS by reference, and the structures are pass by copy. It doesn’t depend on the PROGRAM. |
|
| 18. |
What is default access specifier for data members or member functions declared within a class without any specifier, in C++?(a) Private(b) Protected(c) Public(d) Depends on compilerI got this question in my homework.This intriguing question originated from Classes in chapter OOPs Concept & Features of Object Oriented Programming |
|
Answer» Right answer is (a) Private |
|
| 19. |
Which is known as a generic class?(a) Abstract class(b) Final class(c) Template class(d) Efficient CodeThe question was asked in an interview.My doubt stems from Classes topic in section OOPs Concept & Features of Object Oriented Programming |
|
Answer» CORRECT option is (c) Template class To explain: Template classes are known to be generic classes because those can be used for any data TYPE value and the same class can be used for all the variables of DIFFERENT data types. |
|
| 20. |
Size of a class is _____________(a) Sum of the size of all the variables declared inside the class(b) Sum of the size of all the variables along with inherited variables in the class(c) Size of the largest size of variable(d) Classes doesn’t have any sizeI have been asked this question during an online interview.The origin of the question is Classes in division OOPs Concept & Features of Object Oriented Programming |
|
Answer» RIGHT option is (d) CLASSES doesn’t have any size The explanation is: Classes doesn’t have any size, actually the size of object of the CLASS can be defined. That is done only when an object is created and its constructor is called. |
|
| 21. |
Which class can have member functions without their implementation?(a) Default class(b) String class(c) Template class(d) Abstract classThe question was asked in my homework.I want to ask this question from Classes topic in section OOPs Concept & Features of Object Oriented Programming |
|
Answer» Right option is (d) Abstract class |
|
| 22. |
Which of the following describes a friend class?(a) Friend class can access all the private members of the class, of which it is a friend(b) Friend class can only access protected members of the class, of which it is a friend(c) Friend class don’t have any implementation(d) Friend class can’t access any data member of another class but can use it’s methodsI got this question during an online interview.I'm obligated to ask this question of Classes in portion OOPs Concept & Features of Object Oriented Programming |
|
Answer» RIGHT answer is (a) FRIEND class can access all the private members of the class, of which it is a friend The explanation: A friend class can access all the private members of another class, of which it is a friend. It is a SPECIAL class provided to use when you need to reuse the data of a class but don’t WANT that class to have those special functions. |
|
| 23. |
What is the scope of a class nested inside another class?(a) Protected scope(b) Private scope(c) Global scope(d) Depends on access specifier and inheritance usedI got this question by my college director while I was bunking the class.My question is taken from Classes topic in section OOPs Concept & Features of Object Oriented Programming |
|
Answer» The correct ANSWER is (d) Depends on access specifier and inheritance USED |
|
| 24. |
Class with main() function can be inherited.(a) True(b) FalseThe question was asked in class test.This intriguing question comes from Classes in division OOPs Concept & Features of Object Oriented Programming |
|
Answer» Correct option is (a) True |
|
| 25. |
Which among the following is false, for a member function of a class?(a) All member functions must be defined(b) Member functions can be defined inside or outside the class body(c) Member functions need not be declared inside the class definition(d) Member functions can be made friend to another class using the friend keywordThe question was posed to me in homework.This key question is from Classes topic in portion OOPs Concept & Features of Object Oriented Programming |
|
Answer» The correct answer is (C) MEMBER functions NEED not be declared inside the class definition |
|
| 26. |
Which syntax for class definition is wrong?(a) class student{ };(b) student class{ };(c) class student{ public: student(int a){ } };(d) class student{ student(int a){} };I had been asked this question in exam.Question is from Classes topic in section OOPs Concept & Features of Object Oriented Programming |
|
Answer» Right choice is (b) student class{ }; |
|
| 27. |
Which of the following pairs are similar?(a) Class and object(b) Class and structure(c) Structure and object(d) Structure and functionsI got this question by my college professor while I was bunking the class.The question is from Classes topic in section OOPs Concept & Features of Object Oriented Programming |
|
Answer» The CORRECT choice is (B) Class and structure |
|
| 28. |
Which among the following is false for class features?(a) Classes may/may not have both data members and member functions(b) Class definition must be ended with a colon(c) Class can have only member functions with no data members(d) Class is similar to union and structuresThis question was addressed to me in an interview for internship.This question is from Classes in division OOPs Concept & Features of Object Oriented Programming |
|
Answer» RIGHT choice is (b) Class DEFINITION MUST be ended with a colon The best explanation: Class definition must END with a semicolon, not colon. Class can have only MEMBER functions in its body with no data members. |
|
| 29. |
Instance of which type of class can’t be created?(a) Anonymous class(b) Nested class(c) Parent class(d) Abstract classI got this question in an interview for internship.My doubt stems from Classes topic in section OOPs Concept & Features of Object Oriented Programming |
|
Answer» Correct choice is (d) Abstract class |
|
| 30. |
Which definition best describes an object?(a) Instance of a class(b) Instance of itself(c) Child of a class(d) Overview of a classThis question was posed to me in an online quiz.Asked question is from Objects topic in portion OOPs Concept & Features of Object Oriented Programming |
|
Answer» The correct answer is (a) Instance of a class |
|
| 31. |
How many objects can be declared of a specific class in a single program?(a) 32768(b) 127(c) 1(d) As many as you wantThe question was posed to me in an online interview.This interesting question is from Objects in portion OOPs Concept & Features of Object Oriented Programming |
|
Answer» Right answer is (d) As MANY as you want |
|
| 32. |
Which among the following is false?(a) Object must be created before using members of a class(b) Memory for an object is allocated only after its constructor is called(c) Objects can’t be passed by reference(d) Objects size depends on its class data membersThis question was posed to me in an international level competition.This interesting question is from Objects topic in division OOPs Concept & Features of Object Oriented Programming |
|
Answer» Right choice is (c) Objects can’t be passed by REFERENCE |
|
| 33. |
Which of the following is incorrect?(a) class student{}s;(b) class student{};student s;(c) class student{}s[];(d) class student{}; student s[5];The question was posed to me in an international level competition.I'd like to ask this question from Objects in division OOPs Concept & Features of Object Oriented Programming |
|
Answer» Right ANSWER is (C) class student{}s[]; |
|
| 34. |
The object can’t be __________(a) Passed by reference(b) Passed by value(c) Passed by copy(d) Passed as functionThis question was addressed to me in final exam.My question is based upon Objects topic in section OOPs Concept & Features of Object Oriented Programming |
|
Answer» The correct option is (d) Passed as function |
|
| 35. |
Functions can’t return objects.(a) True(b) FalseI had been asked this question during an interview.My doubt is from Objects in portion OOPs Concept & Features of Object Oriented Programming |
|
Answer» The correct answer is (b) False |
|
| 36. |
How members of an object are accessed?(a) Using dot operator/period symbol(b) Using scope resolution operator(c) Using member names directly(d) Using pointer onlyThis question was posed to me by my school teacher while I was bunking the class.This key question is from Objects topic in portion OOPs Concept & Features of Object Oriented Programming |
|
Answer» Right option is (a) Using dot OPERATOR/period symbol |
|
| 37. |
If a local class is defined in a function, which of the following is true for an object of that class?(a) Object is accessible outside the function(b) Object can be declared inside any other function(c) Object can be used to call other class members(d) Object can be used/accessed/declared locally in that functionThis question was addressed to me in examination.This interesting question is from Objects in section OOPs Concept & Features of Object Oriented Programming |
|
Answer» RIGHT option is (d) Object can be used/accessed/declared locally in that function Explanation: For an object which belongs to a LOCAL class, it is MANDATORY to DECLARE and use the object WITHIN the function because the class is accessible locally within the class only. |
|
| 38. |
Which among the following is wrong?(a) class student{}; student s;(b) abstract class student{}; student s;(c) abstract class student{}s[50000000];(d) abstract class student{}; class toppers: public student{}; topper t;The question was posed to me by my college professor while I was bunking the class.This intriguing question originated from Objects in portion OOPs Concept & Features of Object Oriented Programming |
|
Answer» Correct CHOICE is (b) ABSTRACT class student{}; student s; |
|
| 39. |
When an object is returned___________(a) A temporary object is created to return the value(b) The same object used in function is used to return the value(c) The Object can be returned without creation of temporary object(d) Object are returned implicitly, we can’t say how it happens inside programThe question was asked in semester exam.I'm obligated to ask this question of Objects topic in chapter OOPs Concept & Features of Object Oriented Programming |
|
Answer» Correct choice is (a) A TEMPORARY object is CREATED to return the value |
|
| 40. |
Object declared in main() function _____________(a) Can be used by any other function(b) Can be used by main() function of any other program(c) Can’t be used by any other function(d) Can be accessed using scope resolution operatorThis question was posed to me in homework.My enquiry is from Objects topic in section OOPs Concept & Features of Object Oriented Programming |
|
Answer» Right choice is (C) Can’t be used by any other function |
|
| 41. |
Object can’t be used with pointers because they belong to user defined class, and compiler can’t decide the type of data may be used inside the class.(a) True(b) FalseI had been asked this question by my college professor while I was bunking the class.Enquiry is from Objects topic in portion OOPs Concept & Features of Object Oriented Programming |
|
Answer» Correct answer is (B) False |
|
| 42. |
Which among the following is correct?(a) class student{}s1,s2; s1.student()=s2.student();(b) class student{}s1; class topper{}t1; s1=t1;(c) class student{}s1,s2; s1=s2;(d) class student{}s1; class topper{}t1; s1.student()=s2.topper();The question was asked in examination.The query is from Objects in section OOPs Concept & Features of Object Oriented Programming |
|
Answer» The correct CHOICE is (c) class student{}S1,S2; s1=s2; |
|
| 43. |
Which feature of OOP indicates code reusability?(a) Encapsulation(b) Inheritance(c) Abstraction(d) PolymorphismThe question was asked in an interview for internship.Query is from OOPs Features topic in section OOPs Concept & Features of Object Oriented Programming |
|
Answer» Correct option is (b) Inheritance |
|
| 44. |
Which of the following is not a feature of pure OOP?(a) Classes must be used(b) Inheritance(c) Data may/may not be declared using object(d) Functions OverloadingI got this question by my college director while I was bunking the class.My query is from OOPs Features in portion OOPs Concept & Features of Object Oriented Programming |
|
Answer» The correct answer is (C) Data may/may not be declared using object |
|
| 45. |
If a function can perform more than 1 type of tasks, where the function name remains same, which feature of OOP is used here?(a) Encapsulation(b) Inheritance(c) Polymorphism(d) AbstractionThis question was addressed to me during an interview for a job.My question is from OOPs Features topic in section OOPs Concept & Features of Object Oriented Programming |
|
Answer» The correct option is (c) Polymorphism |
|
| 46. |
If different properties and functions of a real world entity is grouped or embedded into a single element, what is it called in OOP language?(a) Inheritance(b) Polymorphism(c) Abstraction(d) EncapsulationThis question was posed to me during an online interview.My doubt is from OOPs Features in portion OOPs Concept & Features of Object Oriented Programming |
|
Answer» RIGHT choice is (d) Encapsulation Explanation: It is Encapsulation, which groups different properties and functions of a REAL WORLD entity into single ELEMENT. Abstraction, on other hand, is hiding of functional or exact WORKING of codes and showing only the things which are required by the user. |
|
| 47. |
Which among the following doesn’t come under OOP concept?(a) Platform independent(b) Data binding(c) Message passing(d) Data hidingI had been asked this question by my school teacher while I was bunking the class.My question is from OOPs Features in division OOPs Concept & Features of Object Oriented Programming |
|
Answer» Correct CHOICE is (a) PLATFORM independent |
|
| 48. |
How many basic features of OOP are required for a programming language to be purely OOP?(a) 7(b) 6(c) 5(d) 4The question was asked in homework.My question is from OOPs Features topic in section OOPs Concept & Features of Object Oriented Programming |
|
Answer» Right choice is (a) 7 |
|
| 49. |
The feature by which one object can interact with another object is _____________(a) Data transfer(b) Data Binding(c) Message Passing(d) Message readingThe question was posed to me during an online exam.I'm obligated to ask this question of OOPs Features topic in division OOPs Concept & Features of Object Oriented Programming |
|
Answer» The CORRECT choice is (C) Message Passing |
|
| 50. |
Which feature may be violated if we don’t use classes in a program?(a) Inheritance can’t be implemented(b) Object must be used is violated(c) Encapsulation only is violated(d) Basically all the features of OOP gets violatedThis question was posed to me in an internship interview.Asked question is from OOPs Features in chapter OOPs Concept & Features of Object Oriented Programming |
|
Answer» Correct CHOICE is (d) Basically all the features of OOP gets violated |
|