What is the difference between a process and a thread?

Technical
Easy
Flipkart
119.4K views

A fundamental OS question comparing the characteristics, memory usage, and overhead of processes versus threads.

Why Interviewers Ask This

Understanding the distinction is vital for performance optimization and concurrency design. Interviewers check if you know when to use processes for isolation and threads for efficiency within a single application context.

How to Answer This Question

Start by defining both terms clearly. Highlight differences in memory space, creation overhead, and communication mechanisms. Emphasize that threads share memory while processes have separate address spaces. Mention context switching costs and how they impact system performance.

Key Points to Cover

  • Memory space separation
  • Creation and context switch overhead
  • Communication mechanisms
  • Isolation benefits

Sample Answer

A process is an independent program execution with its own memory space, while a thread is a lightweight unit of execution within a process. Threads share the same memory and resources, making communication faster but requiring synchronization. Processes are heavier due to separate memory allocation, offering better isolation and stability against crashes.

Common Mistakes to Avoid

  • Claiming threads cannot crash the whole process
  • Ignoring the sharing of global variables
  • Overlooking security implications of shared memory

Practice This Question with AI

Answer this question orally or via text and get instant AI-powered feedback on your response quality, structure, and delivery.

Start Practicing

Related Interview Questions

Browse all 78 Technical questionsBrowse all 52 Flipkart questions