OOP & Dunder Methods interview questions

12 OOP & Dunder Methods questions from the Python bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.

Free to start: the 2-minute IT readiness check — six questions and a result.

Take the free IT readiness check

or take a mock interview set up for this area

1. What is __init__?

Junior
  1. A.the linearized sequence, computed by C3, that determines which inherited attribute a class uses
  2. B.a class attribute that fixes the allowed instance attributes and avoids a per-instance dictionary to save memory
  3. C.the method returning an unambiguous developer-facing representation, ideally one that could recreate the object
  4. D.the method invoked automatically to initialize a newly created instance's attributes

Answer + AI explanation with Pro

2. Which term means: "the method invoked automatically to initialize a newly created instance's attributes"?

Junior
  1. A.__repr__
  2. B.__slots__
  3. C.__init__
  4. D.method resolution order

Answer + AI explanation with Pro

3. Which statement is correct?

Junior
  1. A.__init__ — the linearized sequence, computed by C3, that determines which inherited attribute a class uses
  2. B.__init__ — a class attribute that fixes the allowed instance attributes and avoids a per-instance dictionary to save memory
  3. C.__init__ — the method invoked automatically to initialize a newly created instance's attributes
  4. D.__init__ — the method returning an unambiguous developer-facing representation, ideally one that could recreate the object

Answer + AI explanation with Pro

4. What is __repr__?

Mid
  1. A.the linearized sequence, computed by C3, that determines which inherited attribute a class uses
  2. B.the method returning an unambiguous developer-facing representation, ideally one that could recreate the object
  3. C.a class attribute that fixes the allowed instance attributes and avoids a per-instance dictionary to save memory
  4. D.the method invoked automatically to initialize a newly created instance's attributes

Answer + AI explanation with Pro

5. Which term means: "the method returning an unambiguous developer-facing representation, ideally one that could recreate the object"?

Mid
  1. A.method resolution order
  2. B.__init__
  3. C.__slots__
  4. D.__repr__

Answer + AI explanation with Pro

6. Which statement is correct?

Mid
  1. A.__repr__ — the linearized sequence, computed by C3, that determines which inherited attribute a class uses
  2. B.__repr__ — a class attribute that fixes the allowed instance attributes and avoids a per-instance dictionary to save memory
  3. C.__repr__ — the method returning an unambiguous developer-facing representation, ideally one that could recreate the object
  4. D.__repr__ — the method invoked automatically to initialize a newly created instance's attributes

Answer + AI explanation with Pro

7. What is method resolution order?

Senior
  1. A.the method returning an unambiguous developer-facing representation, ideally one that could recreate the object
  2. B.the linearized sequence, computed by C3, that determines which inherited attribute a class uses
  3. C.the method invoked automatically to initialize a newly created instance's attributes
  4. D.a class attribute that fixes the allowed instance attributes and avoids a per-instance dictionary to save memory

Answer + AI explanation with Pro

8. Which term means: "the linearized sequence, computed by C3, that determines which inherited attribute a class uses"?

Senior
  1. A.method resolution order
  2. B.__slots__
  3. C.__repr__
  4. D.__init__

Answer + AI explanation with Pro

9. Which statement is correct?

Senior
  1. A.method resolution order — the method returning an unambiguous developer-facing representation, ideally one that could recreate the object
  2. B.method resolution order — a class attribute that fixes the allowed instance attributes and avoids a per-instance dictionary to save memory
  3. C.method resolution order — the linearized sequence, computed by C3, that determines which inherited attribute a class uses
  4. D.method resolution order — the method invoked automatically to initialize a newly created instance's attributes

Answer + AI explanation with Pro

10. What is __slots__?

Senior
  1. A.the method invoked automatically to initialize a newly created instance's attributes
  2. B.the linearized sequence, computed by C3, that determines which inherited attribute a class uses
  3. C.a class attribute that fixes the allowed instance attributes and avoids a per-instance dictionary to save memory
  4. D.the method returning an unambiguous developer-facing representation, ideally one that could recreate the object

Answer + AI explanation with Pro

11. Which term means: "a class attribute that fixes the allowed instance attributes and avoids a per-instance dictionary to save memory"?

Senior
  1. A.__slots__
  2. B.method resolution order
  3. C.__repr__
  4. D.__init__

Answer + AI explanation with Pro

12. Which statement is correct?

Senior
  1. A.__slots__ — the method invoked automatically to initialize a newly created instance's attributes
  2. B.__slots__ — a class attribute that fixes the allowed instance attributes and avoids a per-instance dictionary to save memory
  3. C.__slots__ — the method returning an unambiguous developer-facing representation, ideally one that could recreate the object
  4. D.__slots__ — the linearized sequence, computed by C3, that determines which inherited attribute a class uses

Answer + AI explanation with Pro

Free to start

Start with a free readiness check

Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every OOP & Dunder Methods question come with Pro.

Take the free IT readiness check

or take a mock interview set up for this area

24,000+ questions & coding problemsSoftware & IT16,274 questionsGovernment jobs26 examsAptitudenew questions every timeAI practice interviewwith feedback65 topics to practiseMechanical1,149 questionsGATE ME9 papersEngineering Mathematics381 questions2-minute checkfreeDSA Problems1,422Civil1,005 questionsGATE CE9 papersCS Fundamentals1,209 questionsYour scores6 skillsSystem Design25Electrical / EEE1,047 questionsGATE EE9 papersRun your codeC++ · Java · PythonLow-Level Design144Electronics & Comm.975 questionsGATE EC9 papersAI help on every questionFull-Stack6,282Chemical1,005 questionsGATE CH9 papersAI whiteboardsystem designWork abroadEurope · remote · transfersESE ME1 paperGATE practice papers2019–2026ESE CE1 paperDate alertsbefore the last dateESE EE1 paperBehavioural courseHR round practiceESE ET1 paperResume optimizerProSSC JE ME1 paperApplication trackerSSC JE CE1 paperCompany-wise prepSSC JE EE1 paperRole roadmapsRRB JE1 subjectPriced in ₹UPI · cardsISRO SC1 paperGATE CS9 papersIBPS SO IT1 paperUGC NET CS1 paperSSC CGL26 papersIBPS PO26 papersRRB NTPC26 papersSSC CHSL26 papersIBPS Clerk26 papersSBI Clerk26 papersRRB Group D26 papersSSC CPO26 papersSSC GD26 papers