Interview kitsBlog

Your dream job? Lets Git IT.
Interactive technical interview preparation platform designed for modern developers.

XGitHub

Platform

  • Categories

Resources

  • Blog
  • About the app
  • FAQ
  • Feedback

Legal

  • Privacy Policy
  • Terms of Service

© 2026 LetsGit.IT. All rights reserved.

LetsGit.IT/Categories/Operating Systems
Operating Systemseasy

Processes vs threads — what’s the difference and when does it matter?

Tags
#processes#threads#concurrency
Back to categoryPractice quiz

Answer

A process has its own address space and resources; threads share the same address space within a process. It matters for isolation, memory overhead, and how you manage shared state and concurrency.

Advanced answer

Deep dive

The choice impacts isolation, performance, and failure modes:

  • Processes isolate memory; crashes don’t take siblings down.
  • Threads are cheaper to create and context-switch, but share memory.
  • IPC between processes is costlier than in-process synchronization.
  • Security boundaries are easier with processes.

Examples

Web server model:

Many processes: safer isolation, higher memory
Many threads: less memory, more synchronization risk

Common pitfalls

  • Assuming threads are always faster than processes.
  • Sharing mutable state without proper synchronization.
  • Using threads to get isolation (they don’t provide it).

Interview follow-ups

  • When would you choose multi-process over multi-thread?
  • How do you avoid shared-state bugs in threads?
  • How does the OS schedule threads vs processes?

Related questions

Operating Systems
What causes deadlocks and how can you prevent them?
#deadlock#locks#concurrency
Testing
How do you test asynchronous or concurrent code?
#async#concurrency#determinism
PostgreSQL
MVCC in Postgres: why don’t readers block writers?
#postgres
#mvcc
#concurrency
Java
HashMap vs ConcurrentHashMap: when should you use each?
#java#collections#concurrency
Java
`synchronized` vs `ReentrantLock`: what are the differences?
#java#concurrency#locks