← Infosys Interview Insights

Infosys·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Interviewed for a data science role at Infosys and got asked to walk through OOP concepts in Python. Pretty standard stuff but it still caught me a bit flat-footed on some of the finer details.

Questions Asked (1)

Q1

Can you explain the core object-oriented programming concepts as they apply in Python?

Technical Trade-offsAlgorithms & Data Structures
Author's notes

I knew the basics but fumbled a bit trying to explain the difference between method overriding and overloading in Python since Python doesn't really do overloading the traditional way.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining the four core OOP principles—encapsulation, inheritance, polymorphism, and abstraction—and then explain how each is implemented in Python using its unique features. Use concrete code examples or analogies to illustrate each concept, and highlight Python-specific idioms like duck typing and the use of properties. Conclude by mentioning how these concepts are applied in real-world Python projects, especially in the context of Infosys's software solutions.

Pro tip: Emphasize Python's dynamic nature and how it differs from statically typed languages like Java or C++, showing that you understand the trade-offs and can adapt OOP principles accordingly. Mentioning Python's support for multiple inheritance and MRO (Method Resolution Order) can demonstrate deeper knowledge.

1. Define OOP and its core principles

Briefly define object-oriented programming and list the four main principles: encapsulation, inheritance, polymorphism, and abstraction. Explain that these principles help organize code, promote reuse, and improve maintainability.

2. Explain encapsulation in Python

Describe how encapsulation is achieved in Python using classes, private and protected attributes (with underscores), and properties. Mention that Python relies on convention rather than strict access modifiers.

3. Discuss inheritance and polymorphism

Explain how inheritance allows classes to inherit attributes and methods from parent classes, and how polymorphism enables objects to be treated as instances of their parent class. Highlight Python's support for multiple inheritance and method overriding.

4. Illustrate abstraction and Python's approach

Describe abstraction as hiding complex implementation details and exposing only necessary parts. Mention Python's use of abstract base classes (ABCs) and the abc module to enforce abstraction.

5. Connect to real-world Python usage

Give examples of how these concepts are used in Python frameworks and libraries (e.g., Django, Flask) and how they facilitate code organization and scalability. Relate to Infosys projects if possible.

Key Points to Mention

  • Encapsulation: Use of underscores for private/protected members and @property decorator for getters/setters.
  • Inheritance: Single and multiple inheritance, super() function, and method resolution order (MRO).
  • Polymorphism: Duck typing, method overriding, and operator overloading.
  • Abstraction: Abstract base classes (ABCs) and the abc module.
  • Python-specific features: Dynamic typing, first-class functions, and the lack of strict access modifiers.
  • Real-world application: How OOP principles are used in popular Python frameworks and Infosys projects.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.