How should you prepare for a JavaScript interview?
The Global Interpreter Lock is a lock inside the CPython interpreter that allows only one thread to run Python code at any moment. Two threads inside the same process therefore cannot execute Python code at the same time on two different cores. The earlier questions in this topic covered the basics of Python's memory model, and this answer looks at the one part of that model that surprises everybody who arrives from another language.
The most important thing to understand is what the lock does not stop. It does not stop the kind of concurrency that most real programs need. A thread that is waiting for input or output releases the lock while it waits, so the other threads keep running during that wait. Reading from a socket, querying a database, or simply sleeping are all examples of that. This is why threads are the right tool for work that spends most of its time waiting, such as a program that calls a hundred different web services at once.
The lock does stop one specific thing, which is the running of CPU-heavy Python code in parallel. Two threads that each run a tight loop of arithmetic do not finish in half the time, because they take turns holding the lock instead of working at the same moment. The same work split across two separate processes does run at the same time, because each process has its own interpreter and its own copy of the lock.
There are two details worth having ready for an interview. The first one is that the lock is an implementation detail of CPython and not a guarantee of the Python language. Work is under way to make it optional so that free-threaded builds can run Python code truly in parallel. The second one is that the lock belongs to a single interpreter and not to the whole machine, so several processes can still run Python code at the same time on different cores. That is the reason why multiprocessing, rather than threading, is the right answer for CPU-heavy work in Python.