All jobs / Backend developer

Backend developer interview question · 3–5 years

A CPU-bound function is too slow. You add threads and nothing improves. Why?

The strongest answer

The GIL lets only one thread execute Python bytecode at a time, so threads help blocking I/O, not computation — use processes, a native library that releases the GIL, or move the work out of Python

Why it works

Exactly. Threads for waiting, processes for computing.

What a good answer covers

Answers that fall short

Who gets asked this

More Backend developer questions