Tag view

#async

Cross-subject tag search for related interview cards.

Clear

Results update as you type. Press / to jump straight into search.

Tagged with async

5 cards

Python Hard Theory

Threading, multiprocessing, asyncio, coroutines, `async`/`await`, the GIL, and concurrency vs parallelism

Threads are useful for I/O-bound concurrency, multiprocessing is better for CPU-bound parallel work in CPython, and `asyncio` organizes cooperative I/O with coroutines and `async`/`await`.

  • GIL limits parallel bytecode execution in threads
  • Asyncio is concurrency, not magic parallelism
  • Choose the model based on the workload

Threading, multiprocessing, asyncio, coroutines, `async`/`await`, the GIL, and concurrency vs parallelism

JavaScript Hard Theory

Asynchronous JavaScript: callbacks, callback hell, promises, promise states, promise chaining, async/await, try/catch with async, Promise.all, Promise.allSettled, Promise.race, and Promise.any

Modern async JavaScript is built on promises and `async`/`await`, but you still need to understand callbacks and promise coordination helpers.

  • Promises are pending, fulfilled, or rejected
  • `async` functions return promises
  • Promise combinators solve different coordination problems

Asynchronous JavaScript: callbacks, callback hell, promises, promise states, promise chaining, async/await, try/catch with async, Promise.all, Promise.allSettled, Promise.race, and Promise.any

JavaScript Hard Theory

Event loop, Web APIs, callback queue, microtask queue, macrotask queue, promise queue, and setTimeout behavior

JavaScript's event loop decides when queued async work can return to the call stack, with microtasks running before the next macrotask.

  • The stack must be empty before queued work runs
  • Promise callbacks go to the microtask queue
  • `setTimeout` is a minimum delay, not an exact execution time

Event loop, Web APIs, callback queue, microtask queue, macrotask queue, promise queue, and setTimeout behavior

FastAPI Medium Theory

async and await in FastAPI

Use async endpoints when the work awaits non-blocking I O; sync endpoints are fine for CPU work or blocking libraries.

  • Async improves concurrency for waits
  • Do not block the event loop
  • Choose library support carefully

async and await in FastAPI