For an Amazon SDE interview, object-oriented programming questions usually test whether you understand core design principles, not just syntax. Interviewers expect you to explain concepts clearly and apply them in class design or system modeling problems.

Below are the essential OOP concepts that typically appear.


1. Classes and Objects

Class

A class is a blueprint for creating objects. It defines attributes (data) and methods (behavior).

Object

An object is an instance of a class.

Example

class Car:
    def __init__(self, brand, speed):
        self.brand = brand
        self.speed = speed

    def drive(self):
        return f"{self.brand} is driving at {self.speed} mph"

car1 = Car("Toyota", 60)
print(car1.drive())

Interview focus


2. Encapsulation

Encapsulation means bundling data and methods together and restricting direct access to internal state.

Purpose: