What is the difference between a process and a thread?
Assesses fundamental understanding of Operating Systems conventions, runtime behavior, and memory/performance considerations.
Hiring managers look for precision, avoidance of ambiguous jargon, and ability to explain trade-offs under real production conditions.
A process is a running program with its own virtual address space, code, data, heap, open file descriptors and at least one thread. The operating system isolates processes from one another, so a crash in one usually does not corrupt another.
A thread is the unit of scheduling inside a process. Threads in the same process share the address space, heap, globals and file descriptors, but each has its own stack, registers and program counter.
Process A
code + data + heap + file table
thread 1 (stack, regs) thread 2 (stack, regs)
Because threads share memory, communication is cheap but synchronisation is required; a data race can corrupt shared state. Processes are isolated, so they are safer but communicating between them needs IPC such as pipes, shared memory or sockets, which is slower and more complex. Creating a process is heavier than creating a thread, so thread pools are common for handling many concurrent requests.
Candidate Response Strategy & Interview Tips
- Start with a concise one-sentence summary: Deliver a direct, confident answer first before expanding into nuances.
- Demonstrate real-world trade-offs: Discuss where this approach excels and when you would avoid it in production systems.
- Discuss complexity & edge cases: Proactively explain time/space complexity or boundary conditions (null values, scale limits).
- Prepare for interviewer follow-ups: Technical hiring panels frequently probe deeper into concurrency, backward compatibility, or alternative libraries.