Python
Core Python concepts: decorators, generators, GIL, OOP, and more.
Fundamentals
Variables and Data Types
Understanding Python variables, dynamic typing, and built-in data types.
Mutable vs Immutable Types
Why some Python objects can be changed in place and others can't.
Strings and String Methods
String creation, formatting, and essential methods for interviews.
Lists, Tuples, and Sets
Comparing Python's three main sequence/collection types and when to use each.
Dictionaries
Python's key-value data structure — creation, methods, and common patterns.
Comprehensions
List, dict, set, and generator comprehensions — Python's concise way to create collections.
Type Conversion and Truthiness
How Python converts between types and what counts as True or False.
Functions
Functions and Arguments
Defining functions, *args, **kwargs, default arguments, and the mutable default trap.
Lambda Functions
Anonymous one-line functions and when to use them.
Map, Filter, Reduce, Zip
Functional programming tools for transforming and combining iterables.
Closures and Nonlocal
How inner functions remember variables from their enclosing scope.
Decorators
Functions that modify other functions — Python's most elegant pattern.
Generators and Iterators
Lazy evaluation with yield — producing values one at a time instead of all at once.
Built-in Functions
Essential built-in functions every Python developer should know.
Object-Oriented Python
Classes and Objects
The basics of object-oriented programming in Python — classes, instances, and __init__.
Inheritance and MRO
Single and multiple inheritance, the diamond problem, and how Python resolves method order.
Dunder (Magic) Methods
Special double-underscore methods that let us customize how objects behave.
@staticmethod vs @classmethod
Understanding the difference between static methods, class methods, and regular methods.
Property Decorators
Using @property to create getters, setters, and deleters the Pythonic way.
Abstract Classes and Interfaces
Enforcing method implementation with ABC — Python's way of defining contracts.
Dataclasses
Automatically generating __init__, __repr__, and more with the @dataclass decorator.
Scope & Memory
LEGB Scope Rule
How Python looks up variable names — Local, Enclosing, Global, Built-in.
Shallow vs Deep Copy
Understanding the difference between assignment, shallow copy, and deep copy in Python.
Garbage Collection and Reference Counting
How Python automatically frees memory — reference counting and the cyclic garbage collector.
Global Interpreter Lock (GIL)
Why Python can only run one thread at a time and how it affects performance.
Error Handling & Context
Exception Handling
Catching and handling errors gracefully with try, except, finally, and else.
Custom Exceptions
Creating your own exception classes for better error handling in applications.
Context Managers
The with statement and how to write custom context managers for resource cleanup.
Concurrency & Async
Threading vs Multiprocessing
Running code concurrently with threads or in parallel with processes.
Asyncio and async/await
Writing non-blocking asynchronous code with Python's asyncio framework.
Concurrent.futures
High-level interface for running tasks asynchronously with thread and process pools.
Advanced Python
Metaclasses
Classes that create classes — Python's deepest OOP concept.
__slots__
Restricting instance attributes for memory efficiency and faster access.
Type Hints and Annotations
Adding type information to Python code for better tooling and documentation.
Walrus Operator and Modern Features
Recent Python additions — assignment expressions, pattern matching, and more.
Duck Typing and Protocols
If it walks like a duck — Python's approach to interfaces and structural typing.
Modules & Patterns
Modules, Packages, and Imports
How Python organizes code — modules, packages, __init__.py, and import mechanics.
Pythonic Code and PEP 8
Writing clean, idiomatic Python that follows community conventions.
File Handling and I/O
Reading and writing files in Python — text, binary, CSV, and JSON.
Design Patterns in Python
Common design patterns and their Pythonic implementations.
Common Output Questions
Tricky Python interview questions that test your understanding of core concepts.