Skip to content

Volume ITechnology

3.13.15 — asyncio In Depth ​

A checkout page needs three things before it can show the total: the customer's saved addresses, live stock for each item, and a shipping quote. Each comes from a different service, and each takes about 200 milliseconds. Asked one after another, the page takes 600 milliseconds. Asked all at once, it takes 200. Now multiply that by ten thousand customers checking out at the same time. Ten thousand threads would need gigabytes of memory just for their stacks, and the operating system would spend much of its time switching between them. asyncio does it differently. It runs all ten thousand conversations inside one thread, switching between them only at the exact points where each one is waiting. This page explains how that works, from the generator trick it grew out of, through the event loop, to the rules that keep an async service fast. FastAPI is built on top of all of it.

1. The story: from callbacks to async and await ​

The problem asyncio solves is old. A server spends most of its life waiting: for a database, for another service, for the client to send more bytes. The question is what a single thread should do while it waits.

  1. Callbacks, 2002. The Twisted framework let you say "when this data arrives, call this function". It worked, and it scaled, but code became a pyramid of nested callbacks, the same "callback hell" JavaScript suffered (3.6.8).
  2. Generators that can pause, 2005. PEP 342 added send() to generators (3.13.9). People realised that a generator could yield at the exact point where it needed to wait, and a scheduler could resume it with the result. Code written this way looks sequential but pauses at each wait. The Tornado framework, built at FriendFeed in 2009, used this idea.
  3. yield from, 2012. PEP 380 let one generator hand control to another, so pausable functions could call other pausable functions.
  4. asyncio, 2014. Guido van Rossum designed a standard event loop for Python, first called "Tulip", which became the asyncio module in Python 3.4 (PEP 3156). Coroutines were still generators using yield from.
  5. async and await, 2015. Yury Selivanov's PEP 492, in Python 3.5, gave the pattern its own syntax. async def makes a native coroutine, and await replaces yield from. Under the hood it is the same machinery.
  6. Making it safe, 2018 to 2022. asyncio.run() arrived in 3.7. TaskGroup and asyncio.timeout() arrived in 3.11, inspired by the Trio library's idea of "structured concurrency".

So await is not magic. It is a generator pausing and handing control back to a scheduler. Section 3 proves it by building a scheduler from scratch.

2. Coroutines, await and asyncio.run ​

A function defined with async def is a coroutine function. Calling it does not run its body. It returns a coroutine object, which is a paused computation, exactly like calling a generator function.

python
import asyncio

async def fetch_stock(sku):
    await asyncio.sleep(0.2)                 # (1)
    return sku, 12

pending = fetch_stock("mug")                 # (2)
print(pending)
pending.close()                              # (3)

print(asyncio.run(fetch_stock("mug")))       # (4)
text
<coroutine object fetch_stock at 0x000001FC3ED60D40>
('mug', 12)
  • (1) await means "pause me here until this finishes, and let other work run meanwhile". asyncio.sleep stands in for a network call.
  • (2) Calling the function only created a coroutine object. No line of the body ran.
  • (3) We discard it cleanly. A coroutine that is created and never awaited triggers the warning "coroutine … was never awaited", one of the most common asyncio bugs.
  • (4) asyncio.run creates an event loop, runs the coroutine to completion on it, and closes the loop. It is the entry point of an async program. In FastAPI, the server (Uvicorn) runs the loop for you, so you never call asyncio.run yourself.

You can only use await inside an async def function. That rule spreads upward: a function that awaits must be async, so its caller must await it, and so on up to the event loop. People call this "function colouring". It is the price of making every pause point visible in the code.

3. What await really does: build an event loop ​

Here is the whole idea in about twenty lines. Two couriers each drive a route of several legs. Each leg is a wait. A tiny scheduler runs both couriers in one thread, using a simulated clock so nothing actually sleeps.

python
import heapq

class Sleep:
    def __init__(self, minutes):
        self.minutes = minutes

    def __await__(self):                       # (1)
        yield self.minutes                     # (2)

async def courier(name, legs):
    for minutes in legs:
        print(f"  {name}: driving {minutes} min")
        await Sleep(minutes)                   # (3)
    return f"{name} finished"

def run_all(*coroutines):
    timers = [(0, n, coro) for n, coro in enumerate(coroutines)]   # (4)
    heapq.heapify(timers)
    while timers:
        clock, n, coro = heapq.heappop(timers)                     # (5)
        try:
            minutes = coro.send(None)                              # (6)
        except StopIteration as finished:                          # (7)
            print(f"t={clock}: {finished.value}")
            continue
        heapq.heappush(timers, (clock + minutes, n, coro))         # (8)

run_all(courier("asha", [5, 10]), courier("ravi", [3, 3, 3]))
text
  asha: driving 5 min
  ravi: driving 3 min
  ravi: driving 3 min
  asha: driving 10 min
  ravi: driving 3 min
t=9: ravi finished
t=15: asha finished
  • (1) An object is awaitable if it has __await__, which must return an iterator. A generator function is the easy way to write one.
  • (2) This yield is the real pause. The value travels all the way up through every await in the chain, to whoever called send(). Here it carries a request: "wake me in this many minutes".
  • (3) await Sleep(5) runs Sleep(5).__await__() and passes its yields straight up, exactly like yield from in 3.13.9.
  • (4) The scheduler keeps a heap, a structure that always gives back the smallest item first, of (wake-up time, tie-breaker, coroutine).
  • (5) Take whichever coroutine should wake up soonest.
  • (6) send(None) resumes it. It runs until its next await pauses it, and the yielded number arrives here.
  • (7) When a coroutine returns, Python raises StopIteration carrying the return value. That is the generator protocol again.
  • (8) Schedule the coroutine to wake up after its requested wait.

Follow the output. Both couriers run "at the same time" in one thread. Ravi finishes at minute 9, after three 3-minute legs, while Asha is on her second leg. Asha finishes at 15. The total is the length of the longest route, not the sum of both.

The real asyncio event loop is this same idea with two additions.

  1. Coroutines do not yield numbers. They yield futures: objects representing a result that will arrive later, such as "the reply on this socket". The loop wakes the coroutine when its future is complete, and passes the result back in.
  2. Besides timers, the loop asks the operating system which sockets have data ready. It uses the selectors module, which wraps epoll on Linux, kqueue on macOS and I/O completion ports on Windows. Those are the same kernel mechanisms Part 2 described and Node.js's libuv uses (3.8.1).

Figure 1 shows one turn of the real loop.

① run ready taskseach runs until its next await② due timersasyncio.sleep, timeouts③ ask the OSepoll / kqueue / IOCP④ wake waiting taskstheir futures are doneone thread, foreveruntil the program ends
Figure 1 — One turn of the event loop. Ready tasks run until they pause. Then the loop sleeps in the kernel until either a socket has data or the next timer is due, wakes the tasks that were waiting for those, and goes round again.

Step ③ is where the loop spends its idle time, inside the kernel, using no CPU, with a timeout set to the next timer. One thread can watch tens of thousands of sockets this way.

4. Running things concurrently: tasks ​

Awaiting one coroutine after another runs them one after another. Each await pauses until that one finishes.

python
import asyncio
import time

async def fetch_stock(sku):
    await asyncio.sleep(0.2)
    return sku, 12

async def sequential():
    start = time.perf_counter()
    await fetch_stock("mug")                       # (1)
    await fetch_stock("pen")
    await fetch_stock("lamp")
    print(f"sequential: {time.perf_counter() - start:.2f}s")

asyncio.run(sequential())
text
sequential: 0.60s
  • (1) Nothing else was scheduled, so while this waits the loop has nothing to do.

To run them at the same time, wrap each one in a task. A task is a coroutine that the event loop has been told to drive on its own, in the background. It starts running at the loop's next turn, without anyone awaiting it.

TaskGroup: the modern way ​

Python 3.11 added asyncio.TaskGroup, and it should be your default.

python
async def checkout_data():
    start = time.perf_counter()
    async with asyncio.TaskGroup() as group:                 # (1)
        mug = group.create_task(fetch_stock("mug"))          # (2)
        pen = group.create_task(fetch_stock("pen"))
        lamp = group.create_task(fetch_stock("lamp"))
    print(f"task group: {time.perf_counter() - start:.2f}s",  # (3)
          mug.result(), pen.result(), lamp.result())

asyncio.run(checkout_data())
text
task group: 0.20s ('mug', 12) ('pen', 12) ('lamp', 12)
  • (1) The group owns every task created inside it.
  • (2) create_task schedules the coroutine and returns a task immediately.
  • (3) The async with block does not end until every task in the group has finished. So by this line all results are ready, and the total time is the longest wait, not the sum.

What happens when one task fails? This is where TaskGroup earns its place.

python
async def charge(order_id, fail=False, delay=0.1):
    await asyncio.sleep(delay)
    if fail:
        raise ConnectionError(f"{order_id}: gateway down")
    print(f"  charged {order_id}")
    return order_id

async def charge_all():
    try:
        async with asyncio.TaskGroup() as group:
            group.create_task(charge("ORD-1", delay=0.5))            # (1)
            group.create_task(charge("ORD-2", fail=True))            # (2)
            group.create_task(charge("ORD-3", fail=True, delay=0.15))
    except* ConnectionError as failures:                             # (3)
        print("failed:", [str(e) for e in failures.exceptions])

asyncio.run(charge_all())
text
failed: ['ORD-2: gateway down']
  • (1) A slow task.
  • (2) This one fails after 0.1 seconds.
  • (3) As soon as one task fails, the group cancels all the others, waits for them to stop, and raises an ExceptionGroup (3.13.10). ORD-1 was never charged, and ORD-3 never got far enough to fail.

This is structured concurrency: tasks live inside a block, the block cannot end while any of them is still running, and a failure cleans up its siblings. No task is ever left running in the background after the code that started it has moved on.

gather: the older way ​

asyncio.gather(a(), b(), c()) runs coroutines together and returns their results as a list. It is still everywhere in existing code. Its default failure behaviour is weaker. The first exception is raised to you, but the other tasks keep running in the background with nobody watching them. With return_exceptions=True, failures come back as values in the result list instead.

python
async def charge_some():
    results = await asyncio.gather(
        charge("ORD-1"), charge("ORD-2", fail=True), return_exceptions=True)
    print(results)

asyncio.run(charge_some())
text
  charged ORD-1
['ORD-1', ConnectionError('ORD-2: gateway down')]

Use gather(..., return_exceptions=True) when you deliberately want "try all, report each". Use TaskGroup when the tasks succeed or fail together.

Keep a reference to every task ​

A task created with asyncio.create_task() outside a group can be garbage-collected while still running if nothing holds a reference to it, because the event loop keeps only a weak reference (3.13.13). A "fire and forget" task can therefore silently vanish. Keep tasks in a set, or better, use a TaskGroup.

5. Timeouts and cancellation ​

Every call to another service needs a time limit. Otherwise one slow dependency holds requests open until the whole service runs out of capacity.

python
import asyncio

async def slow_gateway():
    await asyncio.sleep(5)

async def pay():
    try:
        async with asyncio.timeout(0.3):         # (1)
            await slow_gateway()
    except TimeoutError:                         # (2)
        print("gave up after 0.3s")

asyncio.run(pay())
text
gave up after 0.3s
  • (1) asyncio.timeout, added in 3.11, limits everything inside the block.
  • (2) When time runs out, the work inside is cancelled, and a TimeoutError is raised outside the block. Older code uses asyncio.wait_for(coro, timeout), which does the same thing.

How cancellation works ​

Cancelling a task does not kill it instantly. task.cancel() arranges for an asyncio.CancelledError to be raised inside the coroutine at the await where it is paused. That is the throw() method of generators again (3.13.9). So the coroutine gets a chance to clean up.

python
import asyncio

async def sync_inventory():
    try:
        print("  sync started")
        await asyncio.sleep(10)
    except asyncio.CancelledError:
        print("  cleaning up after cancel")      # (1)
        raise                                    # (2)

async def main():
    task = asyncio.create_task(sync_inventory())
    await asyncio.sleep(0.1)
    task.cancel()
    try:
        await task
    except asyncio.CancelledError:
        print("task cancelled:", task.cancelled())

asyncio.run(main())
text
  sync started
  cleaning up after cancel
task cancelled: True
  • (1) Cleanup runs. A finally block or an async with would also run here.
  • (2) Always re-raise CancelledError. If you swallow it, the task carries on as if nothing happened, and timeouts and TaskGroup stop working correctly. CancelledError inherits from BaseException, not Exception, precisely so that a broad except Exception: does not catch it by accident.

6. The cardinal rule: never block the event loop ​

All tasks share one thread. A task only gives up control at an await. So a task that does slow work without awaiting freezes every other task, and every other request, until it is done. Here a heartbeat should tick every 0.1 seconds while a request handler runs.

python
import asyncio
import time

async def heartbeat(start):
    for _ in range(5):
        print(f"  tick {time.perf_counter() - start:.2f}")
        await asyncio.sleep(0.1)

async def blocking_handler():
    time.sleep(0.35)                                     # (1)

async def friendly_handler():
    await asyncio.to_thread(time.sleep, 0.35)            # (2)

async def run(handler):
    start = time.perf_counter()
    await asyncio.gather(heartbeat(start), handler())

print("blocking:")
asyncio.run(run(blocking_handler))
print("to_thread:")
asyncio.run(run(friendly_handler))
text
blocking:
  tick 0.00
  tick 0.35
  tick 0.47
  tick 0.57
  tick 0.68
to_thread:
  tick 0.00
  tick 0.12
  tick 0.23
  tick 0.33
  tick 0.44
  • (1) time.sleep is an ordinary blocking call. The whole thread stops, so the heartbeat could not tick for 0.35 seconds. In a web server, every request on that worker would have frozen.
  • (2) asyncio.to_thread runs the blocking call in a separate thread and awaits its result. The loop stays free, and the heartbeat ticks on time.

Things that block the loop, and their fixes:

BlockingAsync replacement
time.sleepawait asyncio.sleep
requests.gethttpx.AsyncClient
sync database driverasync driver (asyncpg)
big file readasyncio.to_thread
CPU-heavy workprocess pool

For CPU-heavy work, a thread does not help, because of the GIL (3.13.13). Use loop.run_in_executor(process_pool, func, ...) to send it to another process. During development, asyncio.run(main(), debug=True) logs any step that holds the loop for more than 100 milliseconds, which finds these bugs quickly.

7. Limiting concurrency with a semaphore ​

Starting ten thousand requests at once is easy with tasks, and it will overwhelm the service you are calling. An asyncio.Semaphore limits how many tasks may be inside a block at once. It is the async version of the thread semaphore in 3.13.14.

python
import asyncio
import time

gateway = asyncio.Semaphore(2)                         # (1)

async def charge(n, start):
    async with gateway:                                # (2)
        print(f"  t={time.perf_counter() - start:.1f} charging ORD-{n}")
        await asyncio.sleep(0.2)

async def main():
    start = time.perf_counter()
    async with asyncio.TaskGroup() as group:
        for n in range(5):
            group.create_task(charge(n, start))

asyncio.run(main())
text
  t=0.0 charging ORD-0
  t=0.0 charging ORD-1
  t=0.2 charging ORD-2
  t=0.2 charging ORD-3
  t=0.4 charging ORD-4
  • (1) At most two charges at once.
  • (2) Tasks beyond the limit wait here, without blocking the loop, until a slot frees up.

8. Async iteration and async context managers ​

The two protocols from 3.13.9 each have an async version, for when getting the next item, or opening and closing a resource, involves waiting.

python
import asyncio
from contextlib import asynccontextmanager

async def order_pages():                                 # (1)
    for page in range(1, 4):
        await asyncio.sleep(0.01)                        # fetch a page
        yield [f"ORD-{page}{n}" for n in range(2)]

@asynccontextmanager
async def db_connection():                               # (2)
    print("  open connection")
    try:
        yield "conn"
    finally:
        print("  close connection")

async def export():
    async with db_connection() as conn:                  # (3)
        async for page in order_pages():                 # (4)
            print("  page", page)

asyncio.run(export())
text
  open connection
  page ['ORD-10', 'ORD-11']
  page ['ORD-20', 'ORD-21']
  page ['ORD-30', 'ORD-31']
  close connection
  • (1) An async generator: an async def with yield. It may await between items.
  • (2) asynccontextmanager works like contextmanager, but its setup and cleanup may await.
  • (3) async with calls __aenter__ and __aexit__, which are awaited.
  • (4) async for calls __anext__ and awaits each item.

Database sessions, HTTP clients and streaming responses in FastAPI all use these two forms.

9. Context variables: per-request data ​

In a threaded server, per-request data such as a request ID can live in thread-local storage. In asyncio, thousands of requests share one thread, so thread-locals would mix them up. Context variables, from the contextvars module added in 3.7, solve this. Each task gets its own copy of the context, so a value set in one request is invisible to the others.

python
import asyncio
import contextvars

request_id = contextvars.ContextVar("request_id", default="-")    # (1)

def log(message):
    print(f"  [{request_id.get()}] {message}")                     # (2)

async def load_order():
    await asyncio.sleep(0.01)
    log("loaded order")

async def handle(rid):
    request_id.set(rid)                                            # (3)
    log("start")
    await load_order()
    log("end")

async def main():
    await asyncio.gather(handle("req-1"), handle("req-2"))

asyncio.run(main())
text
  [req-1] start
  [req-2] start
  [req-1] loaded order
  [req-1] end
  [req-2] loaded order
  [req-2] end
  • (1) Create the variable once, at module level.
  • (2) Any function, however deep, can read the current request's value without it being passed as a parameter.
  • (3) Each request sets its own value. The two requests interleave, yet each log line carries the right ID.

3.14.5 uses exactly this to put a request ID on every log line of a FastAPI service.

10. asyncio compared with JavaScript ​

If you know JavaScript's event loop (3.6.8), the ideas map closely, with three differences worth knowing.

  1. Starting work. Calling a JavaScript async function starts it immediately and returns a promise. Calling a Python async def function starts nothing. You must await it or wrap it in a task.
  2. The loop is a library. JavaScript always has an event loop. In Python, synchronous code is the default, and the loop exists only inside asyncio.run or a server like Uvicorn.
  3. Swapping the loop. Python lets you replace the event loop implementation. uvloop, which is built on libuv, the library under Node.js, is a drop-in replacement that runs network code two to four times faster, and Uvicorn uses it automatically when it is installed.

What the interviewer will push on ​

"What happens when you call an async def function?" It returns a coroutine object and runs nothing. It runs only when awaited or wrapped in a task. The common bug is forgetting the await, which produces "coroutine was never awaited".

"How does await work under the hood?" A coroutine is a generator-like object. await passes a future up through the call chain to the event loop and pauses. The loop resumes it with send() when the future completes. Building the twenty-line scheduler, or explaining it, shows real depth.

"gather or TaskGroup?" TaskGroup gives structured concurrency: when one task fails, the others are cancelled and all failures are raised as an ExceptionGroup. gather by default leaves the other tasks running when one fails. Use gather(return_exceptions=True) when you want every result regardless of failures.

"What blocks the event loop, and how do you find it?" Any synchronous I/O or CPU work without an await: time.sleep, requests, sync database drivers, heavy JSON parsing. Fix with async libraries, asyncio.to_thread or a process pool. Find it with debug=True, which logs slow steps.

"How does cancellation work?" CancelledError is raised inside the task at its current await. Clean up and re-raise. It is a BaseException, so except Exception does not swallow it.

Something to volunteer that nobody asks for: the event loop holds only weak references to tasks, so a create_task whose result you do not store can be garbage-collected mid-flight. Keep references or use a TaskGroup. Engineers who have run async code in production know this one.

Recall

  • History: Twisted callbacks → generator coroutines (PEP 342, yield from in PEP 380) → asyncio (PEP 3156, 3.4) → async/await (PEP 492, 3.5) → asyncio.run (3.7) → TaskGroup and timeout (3.11).
  • An async def is a coroutine function. Calling it creates a coroutine and runs nothing. asyncio.run starts an event loop.
  • await passes a future up to the loop and pauses, the same mechanism as a generator's yield. The loop runs ready tasks, fires timers, asks the OS (epoll, kqueue, IOCP) which sockets are ready, and wakes waiting tasks.
  • A task runs a coroutine concurrently. TaskGroup gives structured concurrency: it waits for all tasks and cancels the rest on failure. gather is older. Keep references to tasks.
  • asyncio.timeout() cancels work that takes too long. Cancellation raises CancelledError inside the task. Clean up and re-raise.
  • Never block the loop. Use async libraries, asyncio.to_thread for blocking calls, and processes for CPU work. debug=True finds slow steps. Semaphore limits concurrency.
  • async for / async generator, async with / asynccontextmanager. Context variables give each task its own request-scoped values. uvloop speeds up the loop.

Self-test: Why does calling fetch_stock("mug") print nothing? In the twenty-line scheduler, what travels up through await, and what calls send? What does a TaskGroup do when one task fails? Why does time.sleep inside a handler freeze other requests? Why must you re-raise CancelledError?

Quiz Bank ​

FoundationalWhat is the difference between a coroutine and a task?

A coroutine is the paused computation you get by calling an async def function. It does nothing until something drives it, either by awaiting it, which runs it inside the current task, or by giving it to the event loop. A task is a coroutine that has been scheduled on the event loop with create_task or a TaskGroup. The loop drives it independently, so it runs concurrently with other tasks, and it can be awaited later for its result, or cancelled.

AppliedAn async endpoint calls three internal services with three awaits in a row and takes 600 ms. How do you speed it up safely?

The three awaits are sequential, so the time is the sum of the three calls. If the calls do not depend on each other, start them together inside an asyncio.TaskGroup and read each task's result after the block. The time becomes that of the slowest call, about 200 ms. Wrap the group in asyncio.timeout() so a slow dependency cannot hold the request open, and decide what to do when one call fails. Either let the group fail the whole request, or catch that one failure inside its own coroutine and return a fallback, such as showing the page without a shipping estimate. Make sure the HTTP client is async and shared across requests, so connections are reused.

InterviewExplain how a single thread can serve 10,000 concurrent connections with asyncio.

Each connection is handled by a coroutine that spends almost all its time paused at an await, waiting for data on a socket. A paused coroutine is just a small object on the heap, a few kilobytes, with no thread stack and no operating-system thread. The event loop registers all 10,000 sockets with the kernel's readiness mechanism, such as epoll on Linux, and makes one system call that sleeps until any of them has data or a timer is due. It then resumes only the coroutines whose sockets are ready. Each runs until its next await, which takes microseconds. As long as no handler blocks or computes for long, one thread keeps all of them moving, and the cost of an idle connection is memory, not CPU.

StaffAfter moving a service to asyncio, p99 latency got worse even though average latency improved. What would you look for?

Long tail latency in an async service usually means something occasionally holds the event loop, and every request on that worker waits behind it. Look for synchronous calls hidden in async code paths. Common ones are a sync database or HTTP client, file I/O, time.sleep and DNS resolution. Logging handlers that write over the network can block too. So can CPU spikes, such as parsing a very large JSON body or compressing a response. Enable loop debug or a monitor that measures loop lag, and correlate slow requests with slow loop steps. Also check concurrency limits: unbounded fan-out can overload a downstream service, whose slowness then shows up as tail latency. Fix with async libraries, to_thread for unavoidable blocking calls, process pools for CPU work, semaphores for fan-out, and enough worker processes to use every core.

Next: the language and its runtime are now covered. 3.13.16 closes the chapter with the everyday tools that make code look like a senior wrote it: structural pattern matching, f-strings and the new t-strings, and the standard-library modules you will use every week.

Combine chapters into one PDF

Pick the chapters you want. They print in the order you pick them.

Volume I — Technology
Part 0 — Retention & Notation
Part 1 — Foundations of Computation
Part 2 — Operating Systems
2.1 The Kernel
2.2 Processes
2.3 Threads & Scheduling
2.4 Concurrency Under the Hood
2.5 Memory Management
2.6 File Systems
2.7 Input/Output
2.8 Linux for Engineers
2.9 Windows & macOS in Practice
Part 3 — Languages, Compilers & Runtimes
3.6 JavaScript & V8
3.7 TypeScript
3.8 Node.js Internals
3.13 Python & CPython
3.14 FastAPI & Production Python
Part 4 — Data Structures & Algorithms
4.0 Classic Problems — Before NeetCode
4.4 Arrays & Hashing — Problems
4.5 Two Pointers
4.6 Sliding Window
4.8 Stack — Problems
4.9 Linked List — Problems
4.11 Binary Search — Problems
4.13 Trees
4.14 Tree — Problems
4.15 Trie — Problems
4.17 Heap — Problems
4.18 Backtracking — Problems
4.19 Graphs
4.20 Graph — Problems
4.21 Advanced Graph — Problems
4.23 1-D DP — Problems
4.24 2-D DP — Problems
4.26 Greedy — Problems
4.27 Interval — Problems
4.28 Math & Geometry — Problems
4.30 Bit Manipulation — Problems
Part 5 — Networking & the Web
5.3 IP
5.4 Transport
5.6 HTTP
Part 6 — Frontend Engineering
6.1 Browser Internals
6.2 HTML & CSS Mastery
6.3 JavaScript in the Browser
6.4 React, from First Component to Full Shop
6.5 Frameworks & Rendering
6.8 UI Engineering & Patterns
Part 7 — Databases & Storage
7.2 SQL Mastery
7.3 Storage Engine Internals
7.4 Transactions
7.5 NoSQL Taxonomy
7.8 Analytics & Big Data
Part 8 — Security, Identity & Cryptography
8.2 Cryptography
8.3 Protocols of Trust
8.4 Identity: AuthN & AuthZ
8.5 Application Security
8.6 Infrastructure Security
Part 9 — Software Design (LLD)
9.2 OOP Foundations
9.3 Design Principles
9.4 Design Patterns
9.5 Concurrency
9.6 API Design
9.7 LLD Interview Machines
9.9 Node/Express Production Playbook
Part 10 — Distributed Systems & HLD
10.7 Consistency & Consensus
10.8 Messaging & Microservices
10.14 Caching
Building blocks from the design seat
Part 11 — System Design Case Studies
Part 12 — AI & ML Engineering
12.1 What AI Engineering Is
12.2 The Math You Need
12.3 Classical Machine Learning
12.4 Data for ML
12.5 Deep Learning
12.6 Embeddings & Vector Search
12.7 Transformers & LLMs
12.8 Building with LLMs
12.9 Retrieval-Augmented Generation
12.10 Agents
12.11 Adapting Models
12.12 Production AI
12.13 Multimodal AI
12.14 AI Security & Governance
12.15 Case Studies & Capstone
Part 13 — Cloud, DevOps & Infrastructure
13.11 Git, from First Commit to Team Workflow
Part 14 — Containers: Docker & Kubernetes
14.1 Foundations
14.2 Docker
14.3 Kubernetes
14.4 Kubernetes on Azure
Part 15 — The Craft & Career
Nothing picked yet