Level 1: Bronze
A memorized definition. Not wrong, but it stops there.
A process is a running program. A thread is a smaller unit of execution inside a process.
3 stars If you are short on time, start with this one.
In one or two sentences
A process is the unit the OS gives resources to. A thread is a flow of execution inside it. Threads of one process share the same address space.
Say it out loud, or type it below. What you type never leaves this device.
A memorized definition. Not wrong, but it stops there.
A process is a running program. A thread is a smaller unit of execution inside a process.
Correct, but too broad or missing context.
Each process has its own memory. Threads in the same process share code, data and heap, so creating and switching them costs less.
Reaches principle, use and trade-off, with words that invite the next question.
A process owns resources such as the address space and file descriptors. A thread is what the scheduler puts on a CPU. Threads keep only their own stack and register context and share the rest, so communication is easy and switching is light, but you own the races and the synchronization on shared data. Processes are well isolated, so one can die without hurting another, but they pay IPC costs to talk. Choosing between them is a trade between isolation and communication cost.
These are likely next questions from an interviewer. Think of your answer first, then press the button.
1 / 3
What do threads share, and what does each keep?
They share code, data, heap and open files. Each keeps its own stack, register values and program counter.
2 / 3
How do processes exchange data?
Through IPC such as pipes, sockets, shared memory and message queues. Shared memory has no copy and is fast, but you synchronize it yourself.
3 / 3
Multi-process or multi-thread, which do you pick?
Pick processes when isolation matters and a failure must not spread. Pick threads when you share data often and switching cost matters. A browser that runs one process per tab chose isolation.