Become a GOLD member of Deccansoft and get access to 40+ courses!!
NewBatches/Webinars
Packages
Gold Membership
Bestseller
Microsoft Azure Suite & Suite Plus
Power Platform Acadamy
New
Azure DevOps Expert & Expert Plus
MS.NET Foundation For Beginners
MS.NET Full Stack Developer
UI / Web Development
SQL Server & MSBI Tools
Software Testing
Courses
MS.NET Courses (Includes Live Project)
Complete C#, OOPs and Windows Programing
ASP.NET MVC Online Training
ASP.NET WebForms
ASP.NET Core
WCF incl. Web Services and Remoting
WPF incl. MVVM and Prism
LINQ and Entity Framework
Live Project Training for Developing Enterprise Application
Live Project using Ntier Arch (.NET5 + EF Core + Angular)
Microservices using .NET Core
Gold Membership
CareerStep IT Program
Client-side UI Technologies
Building Static Web Pages using HTML and CSS
JavaScript and HTML DOM
jQuery, AJAX and JSON
Building Interactive Web Pages using HTML5 and CSS3
BootStrap + Live Examples
AngularJS + Live Project
Angular + Typescript
ReactJS
KnockoutJS
Xamarin
SQL Server + MSBI
SQL Server 2017
Querying Data with Transact-SQL(70-761)
SQL Server Integration Service (SSIS)
SQL Server Reporting Service (SSRS)
SQL Service Analysis Service (SSAS)
Cloud Computing / Azure / AWS
AZ-900: Microsoft Azure Fundamentals
Azure Suite (AZ-104+AZ-204+AZ-305+ AZ-500)
AZ-104: Microsoft Azure Administrator
AZ-204: Developing Solutions for Microsoft Azure
AZ-305: Microsoft Azure Architect Technologies and Design
DP-203: Data Engineering on Microsoft Azure
Amazon Web Services (AWS)
DevOps Expert
AZ-400: Microsoft Azure DevOps
Docker by Sandeep Soni
Kubernetes by Sandeep Soni
Docker & Kubernetes by Rahul Rampurkar
IaC Using Terraform
Powershell
Microsoft Power Platform
Microsoft Power Platform
Data Analytics using PowerBI (DA-100)
Testing Tools
Manual Testing
Selenium Testing with Java(Live Training)
Others
Python Programming
C and Data Structure
Core Java
OOPs and C++
Advance Java
Complete Azure Training
Pricing
Videos
Testimonials
Azure Certification
Contact Us
Login
Login or Register
×
Sign In
Register
Forgot Password?
How did you find us
WhatsApp
YouTube
LinkedIn
Facebook
Telegram
Twitter
Google
Referred by Friend
Refresh
Input symbols
By clicking Register, you accept to the
terms and conditions
and that you have read our
privacy policy.
Recover Password
×
Submit
Enquiry Now
Where did you come to know about us
WhatsApp
YouTube
LinkedIn
Facebook
LinkedIn Ad
Email
Twitter
Google
Referred
Other
Refresh
Input symbols
Multithreading
Interview Questions and Answer
1. Which of the following is true about threads?
Options:
a. Threads are similar to processes, but differ in the way that they share resources.
b. Threads consumes less processor time.
c. Threads are different from processes.
d. Thread execution is scheduled more frequently.
Reveal Answer
2. How to set thread to highest priority?
Options:
a. ThreadPriority.AboveNormal.
b. ThreadPriority.High.
c. ThreadPriority.Normal.
d. ThreadPriority.Highest.
Reveal Answer
3. What is the output of the following program? class ThreadNaming { static void Main() { Thread.CurrentThread.Name = "main"; Thread worker = new Thread (Go); worker.Name = "worker"; worker.Start(); Go(); } static void Go() { Console.WriteLine ("Hello from " + Thread.CurrentThread.Name); } }
Options:
a. Hello from Main Method
b. Hello from Main Hello from Worker.
c. Hello from Worker
d. Hello from Worker Hello from Main
Reveal Answer
4. Types of scheduling ____________
Options:
a. Preemptive
b. Non-Premptive
c. Preemptive and Non-Premptive
d. None
Reveal Answer
5. In _____________ scheduling, OS can unschedule a thread even if it did not complete its task.
Options:
a. Preemptive
b. Non-preemptive
c. Primitive
d. Non-primitive.
Reveal Answer
6. If multiple threads exist with same priority then a __________ is assigned to each thread.
Options:
a. slice
b. time pulse
c. pulse
d. time slice
Reveal Answer
7. A thread is waiting for processor to be allocated to it in __________ state.
Options:
a. Running
b. Suspended
c. Blocked
d. Ready
Reveal Answer
8. After the execution of all the instructions in the thread it goes to __________state.
Options:
a. Running
b. Suspended
c. Blocked
d. Dead
Reveal Answer
9. A thread is said to be in ___________ state when the resources are not available to it and it is waiting for them.
Options:
a. Sleeping
b. Suspended
c. Blocked
d. Dead
Reveal Answer
10. In .Net every thread has two objects associated with it. Custom object and object of type _____________ .
Options:
a. System.Threads
b. System.Threading
c. System.Threading.Thread
d. Threading.Threads
Reveal Answer
11. _______________________ is responsible for managing the lifetime and the states of the thread.
Options:
a. A Custom object
b. Object of type System.Threading.Thread
c. Can't say
d. Depends on the context
Reveal Answer
12. The process terminates when the __________ terminates
Options:
a. Main thread
b. Process
c. Application
d. Non-background thread
Reveal Answer
13. If a thread executes ____________ the current thread state is changed to waiting and it remains in that state until the thread referred by "t" is terminated.
Options:
a. t.Join()
b. Join(3000)
c. t.IsAlive()
d. t.Abort
Reveal Answer
14. ___________ to check whether the thread is dead or alive.
Options:
a. t.Join()
b. Join(3000)
c. t.IsAlive
d. t.Abort
Reveal Answer
15. _____________________ is a block of code which can be executed by only one thread at any given instance of time.
Options:
a. Critical section
b. Main section
c. Function
d. Structure
Reveal Answer
16. ___________________ is a class whose objects state is not desynchronized when it is being used by more than one thread at the same time.
Options:
a. Thread class
b. safe class
c. Thread safe class
d. Thread unsafe class
Reveal Answer
17. Locking _________ throughput.
Options:
a. improves
b. degrades
c. depends on the context
d. can't say
Reveal Answer
18. Shared/Static members of a class can synchronize the code in them by acquiring the lock on ___________ instance of that class.
Options:
a. Type
b. class
c. method
d. None
Reveal Answer
19. ___________________ is a synchronized resource managed by the OS.
Options:
a. None
b. Semaphore
c. Mutex and semaphore
d. Mutex
Reveal Answer
20. _______________ is used for synchronizing threads
Options:
a. Mutex
b. Semaphore
c. Mutex and semaphore
d. None
Reveal Answer
21. The path of execution of instructions within a process is called a ___________
Options:
a. Sub Process
b. Thread
c. Application
Reveal Answer
22. Thread is used for:
Options:
a. To perform background tasks
b. Handle simultaneous streams of input
c. Maximum usage of multiprocessor environment
d. All the above
Reveal Answer
23. What is Thread Pool?
Options:
a. It is a collection of threads to perform several tasks.
b. used For testing threads connection .
c. It is a collection of thread connection string
d. It is the array of Thread objects created by user.
Reveal Answer
24. How many types of wait handles are there?
Options:
a. 2
b. 3
c. 4
Reveal Answer
25. What is a WaitHandle?
Options:
a. It is a base class for synchronization of objects
b. It encapsulates the objects for shared objects
c. It suspends current running thread.
d. It stops current thread.
Reveal Answer
26. Which of the following methods can be used to avoid deadlock in threading?
Options:
a. Monitor
b. Wait Handles
c. Using ThreadState
d. All the above
Reveal Answer
27. Difference between thread and process?
Options:
a. Both are same
b. Thread is a path of execution and process is a collection of threads
c. Process is a path of execution and thread is a collection of threads
d. Process is a part of thread.
Reveal Answer
28. What is a Foreground Thread?
Options:
a. It keeps the application alive
b. Closes the application as soon as this is closed
c. It is a thread that sleeps for every 1000milliseconds
d. None of the above
Reveal Answer
29. What is a Background Thread?
Options:
a. It keeps the application alive
b. Does not keep the application alive and terminate when all foreground threads are closed
c. It is a thread that sleeps for every 1000milliseconds
d. None of the above
Reveal Answer
30. What is multitasking?
Options:
a. It is running multiple programs at the same time.
b. Performing intense calculations
c. Running programs on different computers
Reveal Answer
31. Is it possible to run multiple threads in a single app domain?
Options:
a. Yes
b. No
Reveal Answer
32. Which of the following methods is the right way to change the thread’s priority?
Options:
a. Threadname.Priority(ThreadPriority.Highest)
b. Threadname.Priority = ThreadPriority.Highest
c. Threadname.PriorityState = ThreadPriority.Highest
d. Threadname.PriorityState(ThreadPriority.Highest)
Reveal Answer
33. How to make a thread to sleep for infinite period and to interrupt such a thread?
Options:
a. Using System.Threading.Timeout.Infinite and use Thread.Start
b. Using System.Threading.Timeout.Infinite and use Thread.Interrupt
c. Using System.Threading.Sleep(MaxTime) and use Thread.Start
d. Using System.Threading.Sleep(MaxTime) and use Thread.Interrupt
Reveal Answer
34. What is Thread.Join()?
Options:
a. Used to run two threads simultaneously
b. To stop an earlier thread
c. This is used to make sure an earlier task on a different thread has completed the execution.
d. None of the above
Reveal Answer
35. Can events be used in Threads?
Options:
a. Yes
b. No
Reveal Answer
36. What is a Monitor object?
Options:
a. It helps in faster execution
b. Allows multiple entry points for all threads
c. Used to ensure a block of code to run uninterrupted.
d. None of the above
Reveal Answer
37. How to debug a thread?
Options:
a. Output Window
b. Debug thread window
c. Immediate window
Reveal Answer
Packages
Gold Membership
Microsoft Azure Suite &Suite Plus
Azure DevOps Expert &Expert Plus
MS.NET Foundation For Beginners
MS.NET Full Stack Developer
UI / Web Development
SQL Server & MSBI Tools
Software Testing
Resources
Blog
Deccansoft
AzureA2Z
Wall of Fame
On-Job Tech Support
About
About BestDotNetTraining
About Trainer
Testimonials
FAQ
Other links
About Us
Contact Us
Leave us a feedback
Sitemap
Privacy Policy
Terms & Conditions
Proudly Powered by