InterviewTreedInterviewTreed

The question library

Technical interview questions and answers

Explore practical questions, clear explanations, and code examples across developer technologies.

Showing 2941–2952 of 3610 questions

Python ProgrammingIntermediate1 min read

OOP

Object-oriented programming groups state and behavior into objects and classes.

Python ProgrammingIntermediate1 min read

__init__ and self

__init__ initializes an instance; self conventionally refers to that instance.

Python ProgrammingIntermediate1 min read

Inheritance

Inheritance lets a class extend a base class when the subtype relationship is meaningful.

Python ProgrammingIntermediate1 min read

Composition

Composition builds objects from collaborating objects and can reduce deep inheritance coupling.

Python ProgrammingIntermediate1 min read

Properties

A property exposes method logic through attribute access.

Python ProgrammingIntermediate1 min read

Duck typing

Duck typing focuses on supported behavior rather than explicit inheritance.

Python ProgrammingIntermediate1 min read

Dependency management

Declare dependency ranges or pins in project metadata and install them in the intended environment.

Python ProgrammingIntermediate1 min read

Logging

logging supports levels, handlers, formatting, and configurable output.

Python ProgrammingIntermediate1 min read

Unit tests

Unit tests verify small behaviors in isolation and should be deterministic.

Python ProgrammingIntermediate1 min read

Mocks

Mocks replace dependencies to control responses and check interactions.

Python ProgrammingIntermediate1 min read

Static type checking

mypy and pyright analyze type annotations to find likely errors without running every code path.