Most Asked Multithreading Interview Questions and Answers in Java | Code Decode
HTML-код
- Опубликовано: 19 авг 2024
- 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:
openinapp.co/u...
Course Description Video :
yt.openinapp.c...
---------------------------------------------------------------------------------------------------------------------------------------
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:
Extending the java.lang.Thread class
Implementing the java.lang.Runnable Interface
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.
----------------------------------------------------------------------------------------------------------------------------------------
Most Asked Core Java Interview Questions and Answers : • Core Java frequently a...
Advance Java Interview Questions and Answers : • Advance Java Interview...
Java 8 Interview Questions and Answers : • Java 8 Interview Quest...
Hibernate Interview Questions and Answers : • Hibernate Interview Qu...
Spring Boot Interview Questions and Answers : • Advance Java Interview...
Angular Playlist : • Angular Course Introdu...
GIT : • GIT
-------------------------------------------------------------------------------------------------------------------------------------
Subscriber and Follow Code Decode
Subscriber Code Decode : www.youtube.co...
Linkedin : / codedecodeyoutube
Instagram : / codedecode25
#javainterviewquestions #multithreadinginterviewquestions #codedecode
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.
Sure SreeRaam. These are really nice topics. We will create videos on them too 👍👍
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.
Many congratulations 🎉🎉🎉👏👏👏👏👏. Well deserved man 👍👍👍👍
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 😊😊
Thank u so much Karishma. This means a lot 🙏👍.
Yes go for more thread topics, wait notify executor api , future, CF etc
Sure Sahil.
Is there any video on executor and future?
One of the best tutor on youtube , explain topics with real life problems .
Big Fan 😁😁😁😁
Thanks Sahil 🙂🙂👏👏
The time you explained a thread with example... I couldn't resist myself to write a comment..... Thanks for sharing the knowledge.... 🥰please keep making videos like this
Means a lot to us Pooja. These comments keeps us motivated to put more such videos 🙏🙂. Thanks ❤❤
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).
Thanks for being a part of team code decode Mallikarjuna . sure we will upload more videos on core Java
fast of all, you have a nice voice and your explanation was awesome,thank you keep doing more like this.👍❤
Thanks Rajashekar
Great explaination, please make a part 2 which covers some advanced topics such as ExecutorService
Sure, we will cover that too soon 👍👍
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
Thanks Adrija 👍👍🙂🙂
Your explanations are simple , crisp and easy to understand the core concepts. Thank you so much for the good work.
Thanks Nibedita 🙂👍
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.
🙏
Sure Madhan. We will put video on that soon 🙂🙂👍👍
yes @Karishma , Can you please do it
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
Lucky to come across your channel during my interview preparation❤️❤️..
Thanks Kaushiki 🙂🙂👍👍
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
What if there is only 1 core ? Parallel processing is not possible then right?
The content and way of explaining is really great !!
Thanks
Very much Useful Video...am waiting for this video.... thank you very much.... explanation is very much clear... thanks for sharing this...😊
Thanks Karthick 👍👍
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?
Sure Rajat. We will do that sure 👍👍
@@CodeDecode Thanks for the response mam. Could you please make video on SOLID Principles & where & how can we use this principles in our project. As it is also asked many times in interview?
Sure Rajat. We will create a video on solid principles too 👍. It's a nice topic 👍👍
Your doing a great job madam 🙏🙏🙏 your videos are really helping a lot to me..Thank you Madam
Thanks for writting back to us Basavaraj. M glad it helps 👍👍
Going Good, keep uploading such interview questions
Sure we will upload more
Thanks a lot, it was so easy but it took me so much time to understand, thanks a lot again
🙂🙂👍👍 glad it helps
Mam after watching you video my all concept all clear 😊😊
All the best pratik
Love the way you explain so easily!! Thank you so much!
Thanks Shreya 🙂👍
Please make full video multithreading and cover all methods of Thread class.
Sure Nilesh 🙂👍
Hi, your videos are good source of learning. Keep up good work. My request to you please make videos on Threading from concurrent package i.e. ExecutorService, ReentranctLock, Semaphore etc.
Sure Viki. We will do that soon 🙂👍. Nice topics
Your videos are useful for me....thanks a lot. expecting more videos
Sure. We will upload more videos 👍👍🙏🙏
Hey please create a 2nd part of this video with the details on thread scheduling and other concept like joining 2 threads etc etc.
This really helps in quickly brushing up the concepts.
Sure Souvik, we will upload next part very soon 👍👍
Video is super useful.Please dont move ur curson.
Thanks Simran. 😊👍. We are really sorry that this disturbs you but we needed to keep us concentrated on the slides as it's very difficult to shoot 30 mins long video talking alone without getting distracted 😅😅😁😁. We will try to reduce it. Thanks for the suggestion 👍👍
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.
Sure Ahmet 👍. Thanks for helping us in deciding the priorities.
Very well explained. Please do make second part of multithreading
Thanks . Sure we will make it soon....
really a big gift for beginners, tq maam
Very good content. Please make a second part with Multithreading with the collection. Also, make videos on Data structure and algorithm interviews question. Also on spring boot annotations
Sure Nitigya, we will create a video covering this 👍👍
Hi Madam
Please create a second video which is include all remainng parts of thread
.your videos are very helpful
Thank you
Sure Shweta, we will do that very soon 👍
Excellent Explanation. Appreciate your efforts. Are you working with some organisation?
Thanks Vaibhav, yes we all are working IT professionals.
Thank you so much,
your tutorials has helped me a lot and all of my concepts get cleared with which I was having difficulty :)
We are so glad to hear that Shanawaj 🙂🙂👍👍thanks a lot
Please upload the next video of multithreading. I need it. Appreciate your hard work.
It is live now please check
ruclips.net/video/tLF1wYZs4Bk/видео.html
your work is amazing. could u please make some more videos on multithreading?
Thanks Tej . Sure 👍👍
u r telling excellent content . but my small suggest is u r telling too fast keep some slow.
Very true. Sure in upcoming videos we will take things slow
Hi code decode do more videos on multithreading keep it up
Sure thanks 🙂
Thanks for ur efforts on this ..can you please make vide on memory management
Sure Naveen we will create it soon
Please make a video about Thread Scheduler !!!
Thanks Jitesh 🙂🙂
Please continue with second video. Nice explanation
Sure. Thanks Pinky for helping us in deciding the priority
Please add more videos for multithreading .Can you cover all the topics in multithreading
Great explanation, Thank you :)
🙂🙂👍👍
Great content and very helpful. Could you please provide a session on Executor Pattern? That would really help 🙏🙏
Sure nisith we would make it soon
This is so helpful. Thank you!
We are glad it is Sachintha. 👍👍😊😊
really good one like it
Thanks shekhar....
tq madam...keep going...its very helpful
You are welcome Naresh .....
complex things you are making easy
Thanks
Perfect!! Keep the good work💯💯
Thanks 🙂👍
Hey Code Decode Team,
Appreciate your efforts!!
Please make a list of all the annotations used in spring framework from spring core to all other useful modules and make a video on it with example.
Interviewers asks most of the annotations in interview so it will help to many people to go through all annotations at one place...
Thanks for sharing knowledge...
Sure. we will make that video too
Continue make videos on this session plz
sure
Thank you for the great content... Can we create a thread by using callable Interface ...?
no it cannot be done. only runnable interface can create thread
Such an awesome explanation! Thank you
Thanks Savita 👍
nice, please do detailed videos on multi threading with examples mam
Sure we will upload them soon 👍🙂
Great explaination,
Could you please do one video of HashSet in Java and internal DS implement HashSet in Java
Sure, in next video, we will cover that👍👍
Thank u very much for the video madam..your videos really helping me to attend the interviews..could u plz make a video on springboot annotations and also on exception handling only 1 video is there..plz make a another video on expection handling.
Sure Basavaraj 👍👍we will upload them soon 👍👍👍
@@CodeDecode Thank you 😊
👍👍all the best for your interviews 🙂🙂
so nice of you for helping.
M glad it helps Gyanaranjan 👍👍
Yes threading is much important.
🙂👍
Mam please make video on comparable future and other advance topics🙏🏻 you are amazing. Thank you so much❤️
sure we will create video on it
Girl you rock thanks !
Thanks 🙂🙂👍👍❤
thank you, madam, nice explanation 😊😊😊
You're welcome suresh.....
love love love !!! thankyou !!!
❤️❤️
Your explanation is awesome.. it's really refreshment course with solid details... Appreciate it
Thanks for the nice words
Excellent content!
Thanks
we can call the run method on class which is implemented by runnable right
Yep
Please continue with second video also thanks for the great content 😃
Thanks Madhuri. It will help us in understanding what next video should be on
Waiting for the 2nd Video
It's almost ready. We will upload soon 👍👍
@@CodeDecode Thank you
Waiting for multithreading part 2
Excellent explanation
Thanks Vaishnavi
nice explanation
Thanks sachin
Please make video on unit testing..
Yes it's in pipeline for us Kumar 🙂👍
Thank you so much for the video . Can you please explain Executer framework and why and when it should be used ?
yes please make a continuation video
Sure 👍👍
Well explained!
Thanks....
Please make os vedio for us..🖥️💛
👍👍
great video
Thanks Aman 👍
Great content, clear explanations.
Are you a Gujarati? :)
Thanks Jai🙃. Yes I am 🙂🙂.But I am an Indian too 😝
@@CodeDecode Right, I should've asked if you are an Indian with Gujarati as your mother tongue. 🙂👍
@@jaikishanpatel7597 😝😝😂😂
Can you just explain what happens to a service when multiple say 1000 requests are sent at the same time. how multithreading can be related here ?
can you please explain thread life cycle
Thanks for the info
You're welcome....
Please do the video on completablefuture
Nice topic 👍 will do that for sure 👍👍
@@CodeDecode Thanks and in the last of the tut please just describe solid principles of java .I mean just for 2-3 mntes if possible..👍
Good content
Thanks Piyush 👍👍
please post a new video with the more details like thread scheduler and deamon threads
Sure 👍👍🙂🙂
Thank you very much di❤🚩.
At time line 7:55
Q which is better (multi tasking) proceess base or thread base?
Every running program is process
And one process have multiplex threads to make the process run
In short thread is a light weight process right? I mean a single thread is a lightweight process
And a bunch of such thread running together makes a complete process
Multi threading is better. You can't keep on creating multiple processes for small tasks.
@@CodeDecode Requesting you to pl. Create top 5 or 10 interview FAQs
For executor framework and concurrency collection api.
Can you write program to design a game like soccer .. which was asked in interviews using threads
Hi Mam..Can I post some testing tough questions will you answer in your next video?
Sure Raj. You can. We will answer them in upcoming videos
@@CodeDecode What are the few interesting defects/bug you have found and got compliment from your manager?
What are the challenges that we might face while performing Parallel,Cross browser testing?
Find some general issues/challenges when you move software from UAT environment to Production?
Once you make a video on these questions I will post remaining questions...
Can you do a video for changing the default server from tomcat to any other server in springboot application.
We already have it
@@CodeDecode Can you please link that video here?
ruclips.net/video/1vg1Qg6cugc/видео.html
Mostly some where here;
ruclips.net/p/PLyHJZXNdCXsdXxY8wupiLenux2Yafn1lN
@@CodeDecode Thank you so much
Time to add completable future in the list?.🤔
Ma'am, microservices interview questions please....
Yes we are planning and we will create the videos soon...
Can you explain the internal working of hashmaps
Sure 👍👍
need more info ThreadScheduler please
Sure 👍👍
Can u make vedios on Maven install , maven update related features of maven project
Yes we are planning on that .... we will make it soon.....
Can we extend run and implement runnable simultaneously, so we can use all methods
Extend run? You mean thread class??
@@CodeDecode yes like can we extend thread and implemet runnable simultaneously for a new clasa
Thread class already internally implements runnable. Why do you need to do it explicitly
@@CodeDecode no just was eager
Thanks for the reply tough
Wat is ur linkedin profile mam ?
Finally👍
You commented so many times that we had to 😅😅. Just kidding. Thanks for the nice suggestion, we enjoyed creating it.
@@CodeDecode 😆
now we will wait for the inner class topic
Sure 😅
Could you help me with the transient and volatile
where is the second part of the video?
Hi, I found there is a typo in the project name. Decode spelling is a mistake. It should be CodeDecodeThreadDemo instead of CodeDecoedThreadDemo. I know there is not an issue from a code point of view but it is impacting clean code architecture.
19:13