📎 Referral Code: —
🎁 Referral Earnings ₹0 →
📊 Dashboard Sign In
🎁 ₹0
Your Referral Earnings → Tap to view
Buy
🛒
Buy Course
Videos
📘
Basic Videos
🚀
Project Related Videos
🐍
Old Videos Style — will be removed soon
📚
Buy Book
After Course Completion
📒
My Interview Tracker — HR calls & follow-ups
📈
My Performance — Track your progress
🎯
Interview Prep — Resume & questions for a job
🏢
Company Interview Questions — with answers
🤖
Central Command — your HQ bot
💼
Jobs — AWS Data Engineer openings
Personal Training
🎬
Live Classes
🎯
My 1:1 Dashboard
🗺️
Course Roadmap
🎤
Mock Interview
🧑‍💼
HR Discussion
🗓️
Slot Booking
📅
My Booked Slots
Passive Income
🎁
Refer & Earn — ₹1,000 per referral
🤝
Browse Job Support
💰
Become a Supporter
🔗
Browse Referrals
📢
Post a Referral
🎓
Course Marketplace — Other Trainers
🧑‍🏫
Teach a Course
📊
My Courses & Earnings
🎬
Reels
AI Tools
🌐
Project Explanation Agent
👤
My Profile
🏢
Recruiter Board
🛟
Support Works

← Stellantis interview questions

🎬No video for this question yet. The written answer is below.

Explain core OOP concepts (Encapsulation, Inheritance, Polymorphism, Abstraction) with examples?
  • What are decorators in Python? How do they work internally?
  • Difference between multithreading vs multiprocessing. When would you use each?
  • How do you handle large data (e.g., 100GB) using Python (especially Pandas limitations)?
  • Explain memory management in Python (heap, stack, garbage collection).

🏢 Stellantis 🏷️ Python #4 of 7

📝 Answer

Interviewer:
Can you explain core OOP concepts like Encapsulation, Inheritance, Polymorphism, and Abstraction with examples?
Candidate:
So basically, let me explain this in a practical way instead of just definitions, because I’ve used these concepts in my real projects. First, Encapsulation. I usually think of it as hiding internal details and exposing only what is necessary. In one of my ETL projects, I created a class for database operations. Instead of exposing connection details, I wrapped everything inside methods like connect and execute_query. So the user of that class doesn’t need to know how the connection works internally. Now Inheritance. This is about reusing code. For example, I had a base class for data processing, and then I created child classes for different data sources like S3, API, and database. Each child class reused common logic and added specific functionality. Polymorphism is about having the same interface but different behavior. So in my project, I had a method called process_data, but its implementation was different depending on whether the source was S3 or API. Same method name, different behavior. Abstraction is kind of related to encapsulation, but here we focus on hiding complexity. For example, I created a base abstract class for ETL jobs, where I defined methods like extract, transform, load, but I didn’t implement them. Each specific job implemented them differently. So overall, OOP helped me structure my ETL pipelines in a clean and reusable way.
class BaseETL:
    def extract(self):
        raise NotImplementedError

    def transform(self):
        raise NotImplementedError

    def load(self):
        raise NotImplementedError
Interviewer:
What are decorators in Python? How do they work internally?
Candidate:
So basically, decorators are something I use when I want to add extra functionality to a function without modifying its original code. Let me explain how I think about it. A decorator is just a function that wraps another function. Internally, Python treats functions as first-class objects, so we can pass functions as arguments and return them. In my project, I used decorators for logging and error handling. Instead of writing logging code in every function, I created one decorator and applied it wherever needed.
def logger(func):
    def wrapper(*args, **kwargs):
        print("Function started")
        result = func(*args, **kwargs)
        print("Function ended")
        return result
    return wrapper

@logger
def process_data():
    print("Processing...")

process_data()
So internally, when we use @logger, Python replaces process_data with the wrapper function. That’s how decorators work.
Interviewer:
What is the difference between multithreading and multiprocessing? When would you use each?
Candidate:
So this is something I learned while optimizing performance. Multithreading uses multiple threads within the same process. But due to Python’s GIL, threads cannot run CPU-bound tasks in true parallel. Multiprocessing uses multiple processes, each with its own memory space, so it can run in parallel. In my project, when I was calling multiple APIs, I used multithreading because it’s I/O-bound. But when I had CPU-heavy tasks like data transformation, I switched to multiprocessing. One challenge I faced was memory usage with multiprocessing, because each process consumes memory. So I had to balance performance and resource usage.
Interviewer:
How do you handle large data (like 100GB) using Python, especially considering Pandas limitations?
Candidate:
So basically, I never try to load 100GB into pandas directly. That would crash the system. First, I think about chunking. Pandas allows reading data in chunks, so I process data in smaller batches. In my project, I used chunk-based processing when reading large CSV files from S3. But honestly, for very large data, I prefer using PySpark or AWS Glue instead of pandas. In one ETL pipeline, I moved from pandas to Spark because pandas couldn’t handle the data size efficiently. So my approach is… use pandas for small to medium data, and Spark for big data.
Interviewer:
Can you explain memory management in Python? (heap, stack, garbage collection)
Candidate:
So basically, memory management in Python is something I didn’t focus on initially, but it became important when handling large data. Python uses two main areas… stack and heap. Stack memory is used for function calls and local variables. It’s automatically managed. Heap memory is used for objects and data structures like lists and dictionaries. Now garbage collection… Python uses reference counting and a garbage collector to free memory. In one of my projects, I faced memory issues while processing large datasets. Then I realized that unused objects were not being released immediately. So I started deleting unnecessary variables and sometimes manually triggering garbage collection. So in simple terms… stack handles execution, heap stores data, and garbage collection cleans up unused memory.
Interviewer (Follow-up):
That’s good. Can you explain a real scenario where improper memory handling caused a production issue?