OOP & Dunder Methods interview questions

12 real OOP & Dunder Methods questions from the Python bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

Free to start

Answers, AI explanations, and a scored voice mock interview

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.

Practice OOP & Dunder Methods free