~/problems

Problems

Basics first, then the classics, then company-style assessments. Every problem has tests you run right here; multi-level ones unlock as you go. See the roadmap.

Async

Async and await

One thread, many waiting tasks: gather, limits with semaphores, timeouts, cancellation and retries.

Main path: 1 problem, about 45 min.

Notes

Async is for waiting, threads are for blocking calls, processes are for CPU. asyncio.gather runs coroutines together; asyncio.Semaphore(n) caps how many are in flight; asyncio.wait_for adds a timeout; a cancelled task raises CancelledError at its next await. Retries: exponential backoff with jitter, and a cap on attempts.

1 problems

Concurrency

Async Many waiting tasks on one thread: limits, timeouts, retries.

esc