Skip to main content

Object Oriented Programming _Oop_ Concepts In Ruby MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Object Oriented Programming _Oop_ Concepts In Ruby with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
35
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
42 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
35

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/35 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 35
★ FPSC ★ PPSC

What is a class in Ruby?

Question 2 of 35
★ FPSC ★ PPSC

Which keyword is used to define a class in Ruby?

Question 3 of 35
★ FPSC ★ PPSC

What does the initialize method do in a Ruby class?

Question 4 of 35
★ FPSC ★ PPSC

In Ruby, what is an object?

Question 5 of 35
★ FPSC ★ PPSC

Which method is used to create a new instance of a class in Ruby?

Question 6 of 35
★ FPSC ★ PPSC

What is the purpose of the attr_accessor method in Ruby classes?

Question 7 of 35
★ FPSC ★ PPSC

Which keyword is used to refer to the current instance of a class in Ruby?

Question 8 of 35
★ FPSC ★ PPSC

What is the purpose of inheritance in Ruby classes?

Question 9 of 35
★ FPSC ★ PPSC

What is encapsulation in Ruby classes?

Question 10 of 35
★ FPSC ★ PPSC

Which method is called automatically when an object is created in Ruby?

Question 11 of 35
★ FPSC ★ PPSC

What does the super keyword do in a Ruby class?

Question 12 of 35
★ FPSC ★ PPSC

Which of the following is a correct way to define a class method in Ruby?

Question 13 of 35
★ FPSC ★ PPSC

In Ruby, what does the extend keyword do?

Question 14 of 35
★ FPSC ★ PPSC

What does the self keyword refer to in Ruby classes?

Question 15 of 35
★ FPSC ★ PPSC

What is the purpose of the attr_reader method in Ruby classes?

Question 16 of 35
★ FPSC ★ PPSC

Which keyword is used to access methods and variables within the same class in Ruby?

Question 17 of 35
★ FPSC ★ PPSC

What is the purpose of the attr_writer method in Ruby classes?

Question 18 of 35
★ FPSC ★ PPSC

In Ruby, what is a superclass?

Question 19 of 35
★ FPSC ★ PPSC

Which keyword is used to define an instance method in Ruby?

Question 20 of 35
★ FPSC ★ PPSC

Which method is called when an object is garbage collected in Ruby?

Question 21 of 35
★ FPSC ★ PPSC

What does the protected keyword do in Ruby classes?

Question 22 of 35
★ FPSC ★ PPSC

What is the purpose of method overriding in Ruby?

Question 23 of 35
★ FPSC ★ PPSC

Which keyword is used to define a class method in Ruby?

Question 24 of 35
★ FPSC ★ PPSC

What does the super keyword do in a Ruby class method?

Question 25 of 35
★ FPSC ★ PPSC

What is the purpose of the private keyword in Ruby classes?

Question 26 of 35
★ FPSC ★ PPSC

In Ruby, what is the purpose of method overloading?

Question 27 of 35
★ FPSC ★ PPSC

In Ruby, what is the purpose of the attr_reader method in a class?

Question 28 of 35
★ FPSC ★ PPSC

What is polymorphism in Ruby?

Question 29 of 35
★ FPSC ★ PPSC

What is the difference between a class method and an instance method in Ruby?

Question 30 of 35
★ FPSC ★ PPSC

Which keyword is used to define a private method in a Ruby class?

Question 31 of 35
★ FPSC ★ PPSC

In Ruby, what is the purpose of the `super` keyword when used in a method?

Question 32 of 35
★ FPSC ★ PPSC

What is the purpose of the `extend` keyword in Ruby classes?

Question 33 of 35
★ FPSC ★ PPSC

In Ruby, which method is used to define getter and setter methods for class attributes?

Question 34 of 35
★ FPSC ★ PPSC

What is the purpose of encapsulation in Ruby classes?

Question 35 of 35
★ FPSC ★ PPSC

What is the purpose of inheritance in Ruby?

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →