Katkat

Explain CPU-Bound vs I/O-Bound Work

AnthropicSoftware Engineer · Technical Screen

Last updated

This question evaluates understanding of CPU-bound versus I/O-bound workloads and their interaction with concurrency models such as multithreading, asynchronous I/O, and multiprocessing in Python, including the impact of the Global Interpreter Lock (GIL) and relevance to tasks like web crawling, parsing, and heavy computation.

Define CPU-bound and I/O-bound workloads. Then compare how multithreading, asynchronous I/O, and multiprocessing behave for each type of workload, especially in Python.

Include:

  • How to recognize each workload in practice.
  • Concrete examples.
  • How the Python GIL affects the choice.
  • Which model fits tasks such as web crawling, parsing, and heavy computation.