Practice
Resources
Contests
Online IDE
New
Free Mock
Events New Scaler
Practice
Improve your coding skills with our resources
Contests
Compete in popular contests with top coders
logo
Events
Attend free live masterclass hosted by top tech professionals
New
Scaler
Explore Offerings by SCALER

OOPs MCQ

Last Updated: Jan 08, 2024
Certificate included
About the Speaker
What will you Learn?
Register Now

OOPS is Object-Oriented Programming.  It is an approach to developing software programming. It was introduced to overcome flaws in the procedural approach to programmings such as reusability and maintainability. Object-oriented programming or OOPS is a methodology of designing an application using classes and objects.

The fundamental idea behind object-oriented language is to combine into a single unit with both data and functions.

The data and functions that operate on that data such as a unit are called an object.

A class is a blueprint from which objects are created. A class describes the state or behavior of an object. A class can have attributes and methods:

  • Attributes: An Attribute is a public variable inside the class/object. For example, Length is an attribute of int data type. In other words, **class attributes** are the variable within a class.  You can access attributes by creating an object of a class and by using dot syntax(.).
  • Methods: A method is a group/block of code that takes input from the user, process it, and provides the output. The method runs only when it is called.

Object: 

An object is an instance of a class. It contains an address and takes up memory space. Objects have states and behavior defined as per their template definition.

Instance member variable: Attributes, data members, field, properties.

Instance member functions: Methods, procedures, actions, operations, services.

Features of OOPS

There are primarily four pillars of OOPS:

  • Data abstraction :
    • Data hiding: It hides implementation details while just presenting the features to the outside world
    • Reduces code complexity
    • Hides details and exposes the essential parts.
  • Inheritance: Reusability
    • Mechanism of deriving a new class from an existing class.
    • Types:
      • Single level
      • Multi-level
      • Multiple
      • Hierarchical
      • Hybrid
  • Polymorphism: Object to take many forms
    • Types:
      • Compile-time polymorphism
      • Run time polymorphism
  • Encapsulation :
    • Hiding the data for purpose of protection.
    • Writing data and functions into a single unit.

OOPs MCQs

1. 

What is an object in c++?

Create a free personalised study plan Create a FREE custom study plan
Get into your dream companies with expert guidance
Get into your dream companies with expert..
Real-Life Problems
Prep for Target Roles
Custom Plan Duration
Flexible Plans
2. 

In which of the following is memory allocated for the objects?

3. 

On what basis is it determined, when a variable comes into existence in memory?

4. 

Select the following which shows the correct constructor.

5. 

To access data members of a class, which of the following is used?

Learn via our Video Courses

6. 

Total access specifiers in OOPS for C++ are?

7. 

Total instances of an abstract class that can be created?

Advance your career with   Mock Assessments Refine your coding skills with Mock Assessments
Real-world coding challenges for top company interviews
Real-world coding challenges for top companies
Real-Life Problems
Detailed reports
8. 

Total types of constructors in C++ are?

9. 

Total types of polymorphism in C++ are?

10. 

Under which pillar of OOPS do base class and derived class relationships come?

11. 

Virtual function should be ________.

12. 

Virtual functions should be defined in?

13. 

What are the total catch blocks that can be used using a single Try block?

14. 

Identify the scope resolution operator.

15. 

What is cout?

16. 

What is the implicit return type of constructor?

17. 

What is the number of parameters that a default constructor requires?

18. 

What type of inheritance does single-level inheritance support?

19. 

When is the object created with a new keyword?

20. 

Which of the following functions can be inherited from the base class?

21. 

Which of the following is not a type of inheritance?

22. 

Which of the following is not an oops concept?

23. 

Which type of inheritance is implemented in the following code below?

24. 

Who developed object-oriented programming?

25. 

Why is a virtual function mainly used to achieve?

26. 

Why is reusability a desirable feature?

27. 

Choose whether True or False: The constructor function can be constant.

28. 

Another name of the generic class is?

29. 

By default, fields in a structure of a C program is?

30. 

Choose the incorrect option below which is not a type of constructor.

31. 

Choose the option below for which instance of the class cannot be created.

32. 

Choose the option below which can show polymorphism.

33. 

Choose the option below which describes the overloading of functions.

34. 

Choose the option below which is not a member of the class.

35. 

Choose the option below which is shown by function overriding

36. 

Choose the option below which is used to free the memory allocated for an object in C++.

37. 

Choose the option below which is used to implement late binding.

38. 

Choose the option below which overloads using the friend function.

39. 

Choose whether True or False: Object cannot be passed as a function.

40. 

Another name of overloading is?

41. 

Data members and member functions of a class are private. default. True or False?

42. 

Dynamic memory allocation can be done using?

43. 

How do encapsulation and abstraction differ?

44. 

Identify the abstract data type among the following.

45. 

Identify the feature using which, one object can interact with another object.

46. 

Identify the feature which can be implemented using encapsulation.

47. 

Identify the feature, which is used to reduce the use of nested classes.

48. 

Identify the incorrect constructor type.

49. 

Identify the operators which cannot be overloaded.

50. 

Identify the option below which cannot be used with the term “virtual”.

51. 

Identify the option below which is not a property of the object.

52. 

Identify the pure object-oriented programming language among the following.

Excel at your interview with Masterclasses Know More
Certificate included
What will you Learn?
Free Mock Assessment
Fill up the details for personalised experience.
Phone Number *
OTP will be sent to this number for verification
+1 *
+1
Change Number
Graduation Year *
Graduation Year *
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
*Enter the expected year of graduation if you're student
Current Employer
Company Name
College you graduated from
College/University Name
Job Title
Job Title
Engineering Leadership
Software Development Engineer (Backend)
Software Development Engineer (Frontend)
Software Development Engineer (Full Stack)
Data Scientist
Android Engineer
iOS Engineer
Devops Engineer
Support Engineer
Research Engineer
Engineering Intern
QA Engineer
Co-founder
SDET
Product Manager
Product Designer
Backend Architect
Program Manager
Release Engineer
Security Leadership
Database Administrator
Data Analyst
Data Engineer
Non Coder
Other
Please verify your phone number
Edit
Resend OTP
By clicking on Start Test, I agree to be contacted by Scaler in the future.
Already have an account? Log in
Free Mock Assessment
Instructions from Interviewbit
Start Test