employer cover photo
employer logo
employer logo

Tata Consultancy Services

Part of Tata Group

Engaged Employer

Tata Consultancy Services Interview Question

Explain OOP principles with a real-world example.

Interview Answer

Anonymous

Dec 4, 2025

OOP has 4 main principles: 1. Encapsulation – Binding data and methods. Example: A class Car hides internal details like engine logic and exposes only methods like start(). 2. Inheritance – Reusing properties from another class. Example: ElectricCar extends Car and reuses features like wheels or brakes. 3. Polymorphism – Same method behaving differently. Example: start() method works differently in DieselCar vs ElectricCar. 4. Abstraction – Showing only essential features. Example: You drive a car without seeing how the engine works internally.