Member-only story
Concurrency vs Parallelism in simple terms (Important question in system design interviews)

One of the most important concepts in programming languages(like go, java, .e.t.c) or distributed computing is the difference between concurrency and parallelism. Both used to speed up a computation using their own methods, so let’s dive into them.
Let’s say we need to prepare pasta with sauce (made of tomato ).
If we have only one burner to use then we will boil water to cook pasta for some time and then take it off and while it is getting boiled, we use burner to prepare some sauce and then take sauce as well from burner and use burner to mix the pasta and sauce. So in this scenario we are performing two cooking tasks like boiling pasta and making sauce at different points in time on same burner , this is loosely based on concurrency.
If we have two burners available, we can use two burners to perform two tasks(boiling pasta, cook sauce) independently on two separate burners and mix them, this is loosely based on parallelism.
Concurrency creates the illusion of parallelism, by multitasking. However the chunks of a task aren’t parallelly processed at the same instant of time. Concurrency is achieved through the interleaving operation of processes on the processing unit.