Quick Nav
| Area | Notes |
|---|
| Language Core | [[Python Programming]] · [[Decorators]] · [[Object Oriented Programming]] |
| Libraries | [[Logging]] |
| Interview Prep | [[Python Interview Questions]] |
Language Core Checklist
- First-class functions, higher-order functions, pure functions
- Functional tools —
map, filter, reduce
- Generators &
yield
- Generator expressions
- Enums
-
ord(), chr()
- Decorators — 3-level nested pattern,
functools.wraps
- OOP — classes,
__init__, self, instance vs class variables
- Encapsulation (
__private)
- Inheritance &
super()
- Polymorphism, operator overloading (
__add__, __eq__, etc.)
- Context managers (
with, __enter__/__exit__)
- Abstract classes (
abc.ABC, @abstractmethod)
- Dataclasses (
@dataclass)
- Type hints &
typing module
-
*args / **kwargs
- List/dict/set comprehensions
-
lambda functions
-
itertools / functools
Python for DSA (Interview-Specific)
sorted(lst, key=lambda x: x[1])
heapq.nlargest(k, lst)
collections.Counter(lst)
collections.defaultdict(list)
collections.deque(maxlen=k)
bisect.bisect_left(lst, target)
float('inf')
float('-inf')
7 // 2
7 % 2
divmod(7, 2)
''.join(lst)
s[::-1]
ord('a'), chr(97)
a, b = b, a
Libraries Checklist
-
logging — levels, handlers, structured logging → [[Logging]]
-
asyncio — async/await, event loop, gather, semaphore → [[Asyncio]]
-
pydantic — data validation, BaseModel, validators → [[Pydantic]]
-
FastAPI — async web framework, DI, middleware → [[FastAPI]]
-
os / pathlib — file system operations
-
json — serialize/deserialize
-
datetime — dates, timezones
-
re — regex
-
requests / httpx — HTTP clients
-
pytest — testing, fixtures, parametrize
-
SQLAlchemy — ORM, async session
Interview Topics (Python-Specific)
| Question | Key Points |
|---|
| Mutable vs immutable types | Lists/dicts mutable; str/int/tuple immutable; default arg [] gotcha |
| GIL (Global Interpreter Lock) | Only one thread runs Python bytecode at a time; use multiprocessing for CPU work |
is vs == | is checks identity (same object in memory); == checks value |
deepcopy vs copy | Shallow copy copies refs; deep copy recursively copies values |
__slots__ | Restrict instance attributes, reduce memory overhead |
@property | Getter/setter without changing API |
@classmethod vs @staticmethod | classmethod gets cls; staticmethod gets neither self nor cls |