Knowing multi-threading and how it works is good, but can we make use of it to solve some real-life problems? An interviewer may ask questions where he/she wants to know how would you tackle some scenarios and leverage multi-threading. Not to be forgotten that concurrency, synchronization and race conditions are to be kept in mind while answering such questions.

Here are some situations given to check your understanding and the ability to solve problems using multi-threading :

1. Given a large array of, say, a million numbers, sort it using multi-threading.

An Array

Sorting an array would involve both reads and writes…

Gaurav Sharma

Software | Algorithms | Astronomy

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store