Most Asked Multithreading Interview Questions and Answers in Java | Code Decode

preview_player
Показать описание
In this video of code decode, you will learn Multithreading Interview Questions and Answers in Java for experienced and freshers which is important in Java Interview Questions and Answers

Udemy Course of Code Decode on Microservice k8s AWS CICD link:

Course Description Video :
---------------------------------------------------------------------------------------------------------------------------------------
Q) What is MultiTasking And Its types. In java interview question and Answers

Performing multiple tasks at one time . There are 2 types of multitasking :
Process based multitasking
Thread based multitasking

Q) What is Multi threading & how is it diff from multi tasking asked In java interview question and Answers

Multithreading is a specialized form of multitasking.

Process-based multitasking is executing several tasks simultaneously where each task is a separate independent process is Process-based multitasking .
For example, process based multitasking enables you to run the Java IDE at the same time that you are using a text editor or visiting a web site using chrome.

Thread-based multitasking is executing several tasks simultaneously where each task is a separate independent part of the same program (called Thread).
For instance,JUnit uses threads to run test cases in parallel. As an application, you can have computer games. You see objects in games like cars, motor bikes etc. They are just threads that run in the game application.

Thus, process-based multitasking deals with the “big picture,” and thread-based multitasking handles the details

Q) Which is better process based multitasking or thread based multitasking and why is one of the most asked java interview question and Answers?
Thread based multitasking is better.

Multitasking threads require less overhead than multitasking processes.

Processes are heavyweight tasks that require their own separate address spaces.

Threads, on the other hand, are lighter weight. They share the same address space and cooperatively share the same heavyweight process.

Interprocess communication is expensive and limited. Context switching from one process to another is also costly. In java interview

Q) Which is better process based multitasking or thread based multitasking and why?
Inter Thread communication is inexpensive, and context switching from one thread to the next is lower in cost.

While Java programs make use of process-based multitasking environments, process-based multitasking is not under Java’s direct control. However, multithreaded multitasking is.

Q) What is a Thread

Threads are light-weight processes within a process.
Java creates threads by using a "Thread Class".

All Java programs have at least one thread, known as the main thread, which is created by the Java Virtual Machine (JVM) at the program’s start, when the main() method is invoked with the main thread.

Q) Types of Thread in java

There are two types of thread – user thread and daemon thread.

Q) How to create a user thread in Java
Thread implementation in java can be achieved in two ways:

When the JVM starts, it creates a thread called “Main”. Your program will run on this thread, unless you create additional threads yourself. The first thing the “Main” thread does is to look for your static void main (String args[]) method and invoke it. That is the entry-point to your program. If you create additional threads in the main method those threads would be the child threads of main thread.

----------------------------------------------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------------------------------------------
Subscriber and Follow Code Decode

#javainterviewquestions #multithreadinginterviewquestions #codedecode
Рекомендации по теме
Комментарии
Автор

Hi code decode, today I passed 2nd round interview. Thank you. I hope you make tech video until I retire. And I am a recent graduate with 1 year of experience.

sproutboot
Автор

Hi Madam, Ur videos are very clearn and gr8. Gr8 job yr doing. keep doing madam ji.
I would like to see more videos..
1. Muti Threading -- more detailed one.
2. MicroSevices
3. Spring Data JPA & Spring Data Rest
4. Deep Cloning & Shallow Cloning.

earthcitizen
Автор

One of the best tutor on youtube, explain topics with real life problems .

Big Fan 😁😁😁😁

SahiMehta
Автор

Yes go for more thread topics, wait notify executor api, future, CF etc

sahilbhasin
Автор

Watched several videos and it was great learning. The way you explain difficult topics in a simple way is commendable. You are amazing and really talented mentor. Keep up the good work and I am sure within no time your channel will grow so fast 😊😊

karishmarawat
Автор

The time you explained a thread with example... I couldn't resist myself to write a Thanks for sharing the knowledge.... 🥰please keep making videos like this

poojakumarisingh
Автор

Thank you so much for being the part of our professional journey. Your videos are helping so much for clearing interviews. Please do more videos on core java. This channel is going to become reference for java interviews(Please make note of it).

AA-dljw
Автор

fast of all, you have a nice voice and your explanation was awesome, thank you keep doing more like this.👍❤

rajashekarreddy
Автор

Your explanations are simple, crisp and easy to understand the core concepts. Thank you so much for the good work.

nibeditasahu
Автор

Very accurate elaborate explanation.. helps to clear basics again when we tend to forget day to day work. Thanks for taking this effort and making the video

yourstrulyAdrija
Автор

Great explaination, please make a part 2 which covers some advanced topics such as ExecutorService

iloradas
Автор

Lucky to come across your channel during my interview preparation❤️❤️..

kaushikigoel
Автор

I agree with @Karishma Rawat. Please make a content on Context Switching.

Thank you for the well detailed series of videos on java and rest of the technologies.
🙏

madhanmmm
Автор

please make video on join, wait,sleep as well .there are so much scenarios based question are asked by interviewer.
And also on Locking and Executor framework

amanabhishek
Автор

Great video! One small thing is that you were mentioning as context switching. It’s not so, actually both main and thread runs in parallel. That’s both sysout getting printed in random order

sira
Автор

Hi Mam, First of all thank you for this crystal clear explanation. Could you please make videos on sorting like (Merge, Heap, Quick, Bubble), I mean how exactly these sorting algorithm internally works, what are their complexities & performance & in which scenario we should use which one? As this is the most asked interview questions. Also in Collections.sort & Arrays.sort which sorting algorithm uses & why?

rajatmahajan
Автор

The content and way of explaining is really great !!

travelexplore
Автор

Very much Useful Video...am waiting for this video.... thank you very much.... explanation is very much clear... thanks for sharing this...😊

karthickselvam
Автор

Hello, your videos are very helpful because they are informative . Please make the second part as well so this topic will be covered fully. Thanks.

ahmettachmuradov
Автор

Going Good, keep uploading such interview questions

Rimanshu