Day 31 of 133

Concurrency in Python: GIL, asyncio, multiprocessing + DSA Heap finish

When threads help, when they don't; futures and queues for ML pipelines.

DSA · NeetCode Heap / Priority Queue

  • Find Median From Data StreamDSA · Heap / Priority Queue

    Interview questions to prep

    1. Walk through the two-heaps trick (max-heap left, min-heap right). What invariant ties them?
    2. What's the space cost over a long-running stream, and how would you bound it (windowed median)?

SWE · Concurrency in Python

  • Interview questions to prep

    1. Explain the GIL and why threading helps I/O-bound but not CPU-bound work in CPython.
    2. When does multiprocessing beat threading for ML workloads?
  • Interview questions to prep

    1. When is asyncio the right choice over threads/processes?
    2. What are common pitfalls with mixing sync and async code?
  • Interview questions to prep

    1. How would you parallelize an embarrassingly parallel inference workload?
    2. Compare ThreadPoolExecutor vs ProcessPoolExecutor — when does each fit, and what does the GIL mean here?

References & further reading