Process vs Thread
MediumCommonMajor: software engineeringmeta, uber, netflix
Concept
A process is an executing program with its own address space. A thread is a lighter execution unit that shares its process’s memory.
Differences
| Aspect | Process | Thread |
|---|---|---|
| Address Space | Own (isolated) | Shared within process |
| Creation Cost | Higher (fork/exec) | Lower |
| Context Switch | Heavier | Lighter |
| Communication | IPC needed | Shared memory; sync primitives required |
| Fault Isolation | Better | Weaker (one thread can corrupt others) |
Interview Tips
- Call out race conditions and need for locks, mutexes, atomic ops.
- Mention scalability: many threads per process; CPU-bound vs I/O-bound.
Reference
Source: InterviewBit OS/CS interview topics.