Loading interview...
The OOP Pillars Exam
A medium Python mock interview question on DataDriven. Practice with AI-powered feedback, real code execution, and a hire/no-hire decision.
- Domain
- Python
- Difficulty
- medium
- Seniority
- junior, mid
Interview Prompt
Implement a small class hierarchy that demonstrates all four pillars of object-oriented programming: encapsulation, inheritance, polymorphism, and abstraction. Create an abstract base class Animal with an abstract method speak(), then two concrete subclasses Dog and Cat. Each should encapsulate a private name and implement speak() differently. Return a list of speak() outputs from a list of animal instances.
How This Interview Works
- Read the vague prompt (just like a real interview)
- Ask clarifying questions to the AI interviewer
- Write your python solution with real code execution
- Get instant feedback and a hire/no-hire decision