Difference between Process and Thread
An OS fundamentals question every backend engineer must nail.
Question
What is the difference between a process and a thread?
Answer
A **process** is an independent execution unit with its own memory space, file descriptors and system resources. A **thread** is a lightweight execution unit *inside* a process that shares memory with sibling threads. Processes are isolated (crash of one doesn't affect others) but expensive to create and communicate between (IPC required). Threads are cheap and can share state directly, but a bug in one can corrupt the entire process, and shared state requires synchronization (locks, atomics).
See question and answer above.
Keep reading
You may also like
interview
AWS: When would you pick S3 over EBS?
The right answer shows you understand *access patterns*, not just storage products.
interview
How does Terraform know what already exists?
The most missed Terraform interview follow-up. Explain state files and how they work.
interview
What happens when you type a URL in the browser?
The definitive end-to-end walkthrough — DNS to render.
Discussion (0)
No comments yet. Be the first to weigh in.