CodeGym /Courses /Java Multithreading /Interview prep | Level 5

Interview prep | Level 5

Java Multithreading
Level 5 , Lesson 15
Available

"Hi, Amigo!"

  Interview questions
1 Name all the states of a Thread object.
2 What states might a thread switch to when it enters a synchronized block?
3 What state will a thread enter when the wait() method is called?
4 What state will a thread enter if wait(500) is called?
5 What state will a thread enter when the notify() method is called?
6 What state will a thread enter when the notifyAll() method is called?
7 Three threads in a synchronized block called wait() on a mutex object.
What state will these threads enter if a fourth thread calls notifyAll()?
8 What is the difference between join(500) and wait(500)?
9 What is the difference between wait(500) and sleep(500)?
10 What state will a thread enter when the yield() method is called?

 

Comments (4)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
matemate123 Level 50, Kraków, Poland
8 May 2023
Chat gpt is very helpful with specific questions.
TheLordJackMC Level 39, Princeton, idk somewhere
4 August 2021
me, doing an interview: kalm not earning any dark matter: angi
Szymon Level 41, Warsaw, Poland
17 April 2021
Does anyone know the answer for no.7?
KIN SOCHEAT Level 34, Phnom Penh, Cambogia
20 June 2020
New/Start: Runnable: Running: Blocked: Dead: