Last Minute Notes

Python

A beginner to advanced Python library: names and mutability, built-in data structures and their internals, closures, decorators and generators, OOP and the data model, CPython internals, the GIL and free-threading, threads, processes and asyncio, NumPy and pandas, typing and modern tooling, and an interview playbook.

Start here for Python prep, from "why did my default list keep growing" to "why is my FastAPI service stalling with idle CPUs". Each page teaches the language the way interviews probe it: what the code does, why CPython behaves that way, and what to use in production. Every predict-the-output answer and internals fact was checked on CPython 3.14, and recent changes (free-threaded builds, the JIT, t-strings, deferred annotations, subinterpreters, uv) are included where they matter.

  1. 01
    Python Fundamentals

    Core Python language notes: how Python runs, names and objects, mutability, numbers, strings, truthiness, control flow, match statements, exceptions, and the everyday idioms interviewers expect you to know.

  2. 02
    Data Structures and the Standard Library

    Python built-in collections in depth: list, tuple, dict, and set internals and time complexity, comprehensions, sorting, the collections module, heapq, bisect, itertools, and the idioms that make Python fast for coding interviews.

  3. 03
    Functions, Closures, Decorators, and Generators

    Python functions in depth: parameter kinds, *args and **kwargs, LEGB scope, closures, first-class functions, decorators with and without arguments, iterators and the iteration protocol, generators, yield from, context managers, and the functools toolkit.

  4. 04
    OOP and the Data Model

    Object-oriented Python: classes and instances, class vs instance attributes, methods, properties, dunder methods and the data model, inheritance, super and the MRO, abstract base classes, protocols, dataclasses, slots, descriptors, metaclasses, and enums.

  5. 05
    CPython Internals and Performance

    How CPython really works: the object model, bytecode and the specializing interpreter, reference counting, immortal objects, the cyclic and incremental garbage collector, pymalloc, interning and caches, the GIL, free-threaded Python, the JIT, subinterpreters, and practical profiling and optimization.

  6. 06
    Concurrency and asyncio

    Concurrency in Python: choosing between threads, processes, asyncio, and subinterpreters, the threading and multiprocessing modules, concurrent.futures, locks and queues, the asyncio event loop, coroutines, tasks, TaskGroup, timeouts, cancellation, blocking-call pitfalls, and production patterns.

  7. 07
    NumPy and the Data Stack

    NumPy for interviews and real work: the ndarray memory model (dtype, shape, strides), vectorization and ufuncs, broadcasting rules, basic vs fancy indexing, views vs copies, axis reductions, reshaping, dtype promotion in NumPy 2, the random Generator API, performance, and a tour of pandas 3, Polars, and Numba.

  8. 08
    Typing, Tooling, and Modern Python

    Type hints from basics to generics, Protocols, TypedDict, TypeIs, and PEP 695 syntax, runtime validation with Pydantic, virtual environments and packaging with pyproject.toml and uv, linting with Ruff, testing with pytest, logging, and a feature map of Python 3.8 to 3.14.

  9. 09
    Python Interview Playbook

    Python interview rehearsal: what each level is expected to know, a 55-question bank with strong-answer checklists, 20 predict-the-output puzzles with explanations, live-coding tasks, production scenarios, cheat sheets, common mistakes, and a 7-day study plan.

Reading Path

Pick Your Level

You areRead in this order
New to Python or coming from another languageFundamentals, Data Structures, Functions
Using Python for DSA roundsData Structures and its DSA templates, then the output puzzles in the Playbook
Preparing for a backend roleAdd OOP, Concurrency and asyncio, and Typing and Tooling
Preparing for a data or ML roleAdd OOP and NumPy and the Data Stack
Preparing for senior or platform rolesAdd CPython Internals
One week leftThe Interview Playbook study plan
  • DSA covers the patterns; this section covers the Python tools to implement them.
  • OOPS covers language-neutral principles and design patterns.
  • Java is useful for contrasting typing, concurrency, and memory models.
  • Operating Systems explains the threads, processes, and epoll underneath Python concurrency.
  • Backend covers building the services these tools run in.

On this page