Interview Question: Concurrency or Parallelism?

KodeKloud
85,841 views •

Concurrency vs Parallelism, Explained With One CPU Core! A single-core Node server handling 10,000 open connections at once looks like magic, but it's just concurrency. When a request is waiting on a database or disk, the core doesn't sit idle. It switches to the next request and comes back once the data is ready, so thousands of tasks make progress by taking turns while only one actually runs at any instant. Parallelism is different. Give the server four cores and four requests run at the exact same physical moment. But four cores won't speed up Node on their own. Node runs your JavaScript on a single thread, so out of the box it touches one core. To use all four, you run four copies of the process behind a load balancer. Rule of thumb: if the work is mostly waiting (databases, files, vendors), concurrency wins and one core goes a long way. If the work is mostly computing (resizing images, training a model), only parallelism makes it faster. Which one would you reach for first, concurrency or parallelism? Drop your answer below. #Concurrency #Parallelism #NodeJS #SystemDesign #BackendDevelopment #CodingInterview #DevOps #Multithreading #CPU #WebDevelopment #SoftwareEngineering #TechInterview #ProgrammingInterview

Keyboard shortcuts

On. Switch them off if they collide with your assistive tools; ? still opens this sheet.

Go to

Press g then the letter.

  • gh Latest
  • gs Sources
  • gm Media
  • gv Videos
  • gp Podcasts
  • gc Calendar
  • gd Decoder
  • gz Dataviz
  • ga Datasets
  • gb Blog
  • gk Markets
  • gj Careers
  • gn Prompt Notebook

On this page

  • / Focus search, where there is one
  • t Back to top
  • ? This list
  • Esc Close