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

  1. Read the vague prompt (just like a real interview)
  2. Ask clarifying questions to the AI interviewer
  3. Write your python solution with real code execution
  4. Get instant feedback and a hire/no-hire decision