Operating System - Interview Questions and Answers for 'Scheduling' | Search Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com

Search Interview Questions


 More than 3000 questions in repository.
 There are more than 900 unanswered questions.
Click here and help us by providing the answer.
 Have a video suggestion.
Click Correct / Improve and please let us know.
Label / Company      Label / Company / Text

   



Operating System - Interview Questions and Answers for 'Scheduling' - 9 question(s) found - Order By Rating

 Q1. What is Time slicing with respect to Threads ?Operating System
Ans. Time Slicing is the process to divide the available CPU time to the available runnable threads.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     Time Slicing  threads  thread scheduling   thread scheduler


Usually asked only to fresh graduates.
 Q2. Why threads block or enters to waiting state on I/O?Operating System
Ans. Threads enters to waiting state or block on I/O because other threads can execute while the I/O operations are performed.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   threads   multithreading   scheduling   operating system


Frequently asked to fresh graduates.
 Q3. What is the difference between yield() and sleep()?Operating System
Ans. When a object invokes yield() it returns to ready state. But when an object invokes sleep() method enters to not ready state.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   threads   multi threading   yield   sleep   scheduling   operating system     Asked in 4 Companies      basic        frequent


Usually asked only to fresh graduates.
 Q4. What is the difference between time slicing and preemptive scheduling ?Operating System
Ans. In preemptive scheduling, highest priority task continues execution till it enters a not running state or a higher priority task comes into existence. In time slicing, the task continues its execution for a predefined period of time and reenters the pool of ready tasks.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     operating system   scheduling   threads   multi threading        rare


 Q5. Can a lock be acquired on a class ?
Ans. Yes, a lock can be acquired on a class. This lock is acquired on the class's Class object.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   scheduling   threads   multi threading      expert        rare


 Q6. What state does a thread enter when it terminates its processing?
Ans. When a thread terminates its processing, it enters the dead state.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   threads   multi threading   scheduling   thread states


 Q7. What is an object's lock and which object's have locks?
Ans. An object's lock is a mechanism that is used by multiple threads to obtain synchronized access to the object. A thread may execute a synchronized method of an object only after it has acquired the object's lock. All objects and classes have locks. A class's lock is acquired on the class's Class object.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   threads   multi threading   scheduling   synchronizing


Frequently asked to fresh graduates.
 Q8. Explain Thread States ?Operating System
Ans. Runnable - waiting for its turn to be picked for execution by the thread schedular based on thread priorities.

Running - The processor is actively executing the thread code. It runs until it becomes blocked, or voluntarily gives up its turn.

Waiting: A thread is in a blocked state while it waits for some external processing such as file I/O to finish.

Sleeping - Java threads are forcibly put to sleep (suspended) with Thread.sleep. they can resume using Thread.resume method.

Blocked on I/O - Will move to runnable after I/O condition like reading bytes of data etc changes.

Blocked on synchronization - Will move to Runnable when a lock is acquired.

Dead - The thread is finished working.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   threads   multi threading   scheduling   thread states   basic interview question     Asked in 1 Companies      basic        frequent

Try 2 Question(s) Test


 Q9. Difference between yield() and sleeping()?
Ans. When a task invokes yield(), it changes from running state to runnable state. When a task invokes sleep(), it changes from running state to waiting/sleeping state.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like         Discuss         Correct / Improve     java   threads   multi threading   scheduling   thread states   yield   sleeping



Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked: