issue 117apr 27mmxxvi
est. 2017
Sun, 27 Apr 2026
vol. IX · no. 117
PapersAdda
placement intelligence, since 2017
640+ briefs · 24 campuses · by reservation
verified offers · sourced from r/developersIndia
razorpay₹65.00 LPA· iit-d · sde-1google₹54.00 LPA· iiit-h · swe-imicrosoft₹49.50 LPA· iit-b · sdeatlassian₹38.00 LPA· nit-w · sde-1amazon₹44.20 LPA· bits-p · sde-1uber₹42.00 LPA· iit-kgp · sde-1razorpay₹65.00 LPA· iit-d · sde-1google₹54.00 LPA· iiit-h · swe-imicrosoft₹49.50 LPA· iit-b · sdeatlassian₹38.00 LPA· nit-w · sde-1amazon₹44.20 LPA· bits-p · sde-1uber₹42.00 LPA· iit-kgp · sde-1

Python OOPs Interview Questions 2026: 30 Q&A With Code

11 min read
Interview Questions
Updated: 8 Jun 2026
Aditya Sharma
Aditya's Edit

PapersAdda 2026 Placement Cycle

By Aditya Sharma·Founder & Editor, PapersAdda

What changed in 2026 drives

Mass-recruiter offer letters are flatter for 2026 batch - the 4-5 LPA ASE band has barely budged in three years while inflation eats real wages. Premium tracks (Digital, Pro, Elite, Specialist) are still where the differential lives, and they are entirely test-driven. If you are aiming higher than the default offer, the coding round is not optional pageantry - it is the entire interview.

What I'd actually study for this

  • 01Two solid coding-round answers (1 medium-hard DSA each, with edge-case discussion) > five half-baked ones
  • 02One real project you can defend end-to-end - file paths, design decisions, and what you would change
  • 03One DBMS schema you actually built (not a textbook ER diagram), with at least 3 join-heavy queries written from memory
  • 04Three behavioural STAR stories: failure recovered, conflict handled, ownership taken

Where most candidates trip up

The single biggest mistake is treating company-specific guides as primary prep and DSA as secondary. It is the opposite. Mass recruiters use the test as a filter, but premium tracks at every IT services company use coding to allocate offer band. Spend 70% of prep time on DSA + system fundamentals, 20% on company-specific patterns, 10% on HR rehearsal. Reverse that ratio and you collect the default offer.

Editorial commentary by Aditya Sharma · written for PapersAdda · not generated, not aggregated.

Last Updated: June 2026 | Level: Freshers to Mid-Level | Read Time: ~16 min

Python's object model is a favourite interview area because it differs subtly from Java and C++. Candidates report that self, class versus instance attributes, dunder methods, and the method resolution order are guaranteed topics for Python developer and data-engineering roles. This guide covers 30 Python OOP questions with full answers and runnable code. Behaviour reflects the official Python data-model documentation; confirm any version-specific detail on the official docs.

Pair this with Python Interview Questions 2026 and Python Data Structures Interview Questions 2026.


Table of Contents

  1. Classes and Instances (Q1 to Q10)
  2. Inheritance and MRO (Q11 to Q19)
  3. Dunder and Special Methods (Q20 to Q26)
  4. Advanced (Q27 to Q30)
  5. Predict the Output
  6. Quick Revision Table
  7. Frequently Asked Questions

Classes and Instances

Q1. What is the role of self in Python? Easy

class Dog:
    def __init__(self, name):
        self.name = name      # self ties data to this instance
    def bark(self):
        return f"{self.name} says woof"

Q2. What is the difference between a class attribute and an instance attribute? Medium

class Counter:
    total = 0            # class attribute, shared
    def __init__(self):
        self.id = Counter.total
        Counter.total += 1

Q3. What is init and is it a constructor? Easy


Q4. What is the difference between new and init? Hard


Q5. What are instance, class, and static methods? Medium

class Pizza:
    def __init__(self, size): self.size = size
    @classmethod
    def large(cls): return cls(16)        # alternative constructor
    @staticmethod
    def area(r): return 3.14 * r * r       # utility

Q6. What is encapsulation in Python? Medium


Q7. What is name mangling? Hard


Q8. What are property decorators? Medium

class Account:
    def __init__(self): self._balance = 0
    @property
    def balance(self): return self._balance
    @balance.setter
    def balance(self, v):
        if v >= 0: self._balance = v

Q9. What does slots do? Hard


Q10. What is a dataclass? Medium

from dataclasses import dataclass
@dataclass
class Point:
    x: int
    y: int

Inheritance and MRO

Q11. How does inheritance work in Python? Easy

class Animal:
    def speak(self): return "..."
class Cat(Animal):
    def speak(self): return "meow"

Q12. What is super() and why use it? Medium

class Base:
    def __init__(self): self.a = 1
class Derived(Base):
    def __init__(self):
        super().__init__()   # run Base setup first
        self.b = 2

Q13. What is the method resolution order (MRO)? Hard


Q14. How does Python solve the diamond problem? Hard


Q15. What is the difference between isinstance and issubclass? Easy


Q16. What is duck typing? Medium


Q17. What is an abstract base class? Medium

from abc import ABC, abstractmethod
class Shape(ABC):
    @abstractmethod
    def area(self): ...

Q18. What is method overriding and does Python have overloading? Medium


Q19. What is a mixin? Hard


Dunder and Special Methods

Q20. What is the difference between str and repr? Medium


Q21. How do you make a class comparable? Medium


Q22. How do you make an object iterable? Medium

class Range3:
    def __iter__(self):
        for i in range(3): yield i

Q23. What does call do? Hard


Q24. How do you support len() and indexing? Medium



Q26. What are context managers and enter/exit? Medium

with open("f.txt") as f:    # __enter__/__exit__ handle close
    data = f.read()

Advanced

Q27. What is a metaclass? Hard


Q28. What is the difference between composition and inheritance in Python? Medium


Q29. Are everything-is-an-object claims true in Python? Medium


Q30. How does garbage collection work in Python? Hard


Predict the Output

Snippet 1

class A:
    items = []
    def add(self, x): self.items.append(x)
a, b = A(), A()
a.add(1); b.add(2)
print(a.items)

Output:

[1, 2]

Why: items is a class attribute shared by all instances, so both appends modify the same list. The classic mutable-class-attribute trap. Use self.items = [] in __init__ for per-instance lists.


Snippet 2

class A:
    def who(self): return "A"
class B(A):
    def who(self): return "B " + super().who()
print(B().who())

Output:

B A

Why: B.who calls super().who() which resolves to A.who via the MRO, concatenating the results.


Snippet 3

print(type(type))
print(isinstance(5, object))

Output:

<class 'type'>
True

Why: type is its own metaclass, and every value including int derives from object, so 5 is an instance of object.


Quick Revision Table

ConceptKey takeaway
selfexplicit instance reference
class vs instance attrshared vs per-object
init vs newinitialise vs create
MROC3 linearisation, deterministic
super()delegates to next in MRO
str vs reprreadable vs unambiguous
eq and hashdefine together for hashable
mutable class attrshared, common trap

Frequently Asked Questions

Which Python OOP topic is asked most in 2026?

Candidates report that the difference between class and instance attributes, the role of self, and the method resolution order for multiple inheritance are the three most repeated Python OOP questions.

Do Python interviews ask about dunder methods?

Yes. __init__, __str__, __repr__, __eq__, and __len__ come up regularly, with interviewers asking you to make a class printable, comparable, or iterable by implementing the right dunder.

Is multiple inheritance asked in Python interviews?

Often, because Python allows it. Interviewers probe the C3 linearisation MRO, the role of super, and the diamond problem, which Python resolves deterministically unlike Java, which bans class multiple inheritance.

Why does a mutable class attribute cause bugs?

Because it is shared across all instances, so appending to a class-level list affects every object. Always initialise mutable per-instance state inside __init__ with self, never as a bare class attribute.

What is the difference between a classmethod and a staticmethod?

A classmethod receives the class as cls and is commonly used for alternative constructors, while a staticmethod receives nothing and is just a function grouped under the class for namespacing.



Confirm any version-specific behaviour on the official Python documentation before your interview. This guide reflects candidate-reported patterns and public preparation resources as of June 2026.

Methodology applied to this articlelast verified 8 Jun 2026
Sources used
Public exam-pattern documents, official recruiter pages, and verified candidate reports on r/developersIndia and LinkedIn.
Verification window
Page last edited 8 Jun 2026 by Aditya Sharma. Numbers and patterns sanity-checked against the most recent 2026 cycle drives we tracked.
What we did NOT do
  • No fabricated salary numbers or success rates. If we quote a range, it's sourced.
  • No noun-substituted templates. This article was not generated by swapping company names in a stock prompt.
  • No paid placements, sponsored coaching links, or affiliate-shilled course pushes.
Verification policy: /editorial-standards/. Found something incorrect? Submit a correction - we respond within 48 hours.

Explore this topic cluster

More resources in Interview Questions

Use the category hub to browse similar questions, exam patterns, salary guides, and preparation resources related to this topic.

Paid contributor programme

Sat this this year? Share your story, earn ₹500.

First-person experience reports help future candidates prep smarter. We pay verified contributors ₹500 via UPI per accepted story - with byline.

Submit your story →

Ready to practice?

Take a free timed mock test

Put what you learned into practice. Our mock tests match the 2026 pattern with timer, navigator, reveal, and score breakdown. No signup.

Start Free Mock Test →

Related Articles

More from PapersAdda

Share this guide: