1. Home
  2. Docs
  3. Interview Technical Quest...
  4. C# Technical Interview Qu...
  5. Section 6: Async / Multithreading (71–80)

Section 6: Async / Multithreading (71–80)

71. What is multithreading?
Running multiple threads concurrently to improve application responsiveness.

72. What is the difference between a thread and a task?

  • Thread: OS-level unit of execution
  • Task: .NET abstraction over asynchronous work, managed by the thread pool

73. What is the async keyword?
Marks a method as asynchronous, allowing await calls inside it.

74. What is the await keyword?
Pauses execution of an async method until the awaited task completes, without blocking the thread.

75. Difference between Task and ValueTask?

  • Task: always allocates an object
  • ValueTask: avoids allocation for high-performance scenarios

76. What is a deadlock?
Two or more threads waiting on each other indefinitely, preventing progress.

77. How do you prevent deadlocks?

  • Avoid nested locks
  • Use async/await properly
  • Minimize lock duration

78. What is a thread pool?
A pool of reusable threads managed by .NET to reduce the cost of thread creation.

79. Difference between lock and Monitor?

  • lock is syntactic sugar for Monitor.Enter and Monitor.Exit.
  • Monitor provides more advanced features like Wait and Pulse.

80. What is CancellationToken?
Used to cancel tasks or async operations cooperatively.

How can we help?