All 68 questions
How do async and await work in C#, and when should you use them?
Asked in 11 of 95 interviews · last asked Oct 5 · Concept · Mid-level
Show answer
async lets a method use await; the compiler turns its body into a state machine. When an awaited operation is incomplete, await pauses the method without blocking the thread and resumes it later. Use this for I/O, such as HTTP or database calls, to keep apps responsive and avoid blocking server threads.
- The method runs synchronously until it reaches an await whose operation is incomplete.
- Async methods usually return Task or Task<T>. Avoid async void except for event handlers.
- async does not create a thread. For CPU-heavy work, Task.Run can keep a UI responsive.
- await rethrows task exceptions. Blocking with .Result or .Wait() can cause deadlocks.
What the interviewer checks: The interviewer checks whether you understand nonblocking execution, task handling, and when asynchronous code is useful.
Other ways it was asked
- “What are async and await in C#, and how do they support asynchronous programming?”
- “What are async and await in C#, and why are they important?”
- “How do async and await work in C#, and when would you use them?”
What does ConfigureAwait do, and when should you use ConfigureAwait(false)?
Asked in 4 of 95 interviews · last asked Sep 29 · Concept · Senior
Show answer
ConfigureAwait controls whether an await tries to resume on the captured context. ConfigureAwait(false) skips that capture; it does not force a new thread. Use it in library code that does not need the caller’s context. Avoid it when later code needs the UI context or ASP.NET Framework request context.
- By default, task awaits capture a SynchronizationContext or, without one, a non-default TaskScheduler.
- ASP.NET Core normally has no custom SynchronizationContext, so ConfigureAwait(false) usually makes no scheduling difference.
- It affects only that await, not every await in the method.
- It can prevent some blocking deadlocks, but awaiting instead of using .Result or .Wait() is safer.
What the interviewer checks: The interviewer checks whether you understand continuation scheduling and when code depends on its original context.
Other ways it was asked
- “What does ConfigureAwait do, and when might you use ConfigureAwait(false)?”
- “What is ConfigureAwait(false) and when would you use it?”
- “Do you need to use ConfigureAwait(false) in C# async methods, and when?”
How do tasks and threads differ in .NET, and when would you choose each?
Asked in 3 of 95 interviews · last asked Oct 5 · Concept · Mid-level
Show answer
A Task represents an operation and its completion; a Thread is an execution resource. A task does not need its own thread, especially during asynchronous I/O. Choose tasks for most concurrent work because they support await, results, and error handling. Choose a Thread when you need a dedicated thread or control over its priority or apartment state.
- Task.Run normally runs CPU work on a thread pool thread.
- Use asynchronous I/O APIs directly; wrapping them in Task.Run is usually unnecessary.
- A task may complete without ever running on a separate thread.
- Dedicated threads require more manual management and consume resources even when blocked.
What the interviewer checks: The interviewer checks whether you distinguish operations from execution resources and choose the right tool for the work.
Other ways it was asked
- “What is the difference between a Task and a Thread in .NET?”
- “What is the difference between a thread and a task in .NET?”
- “Can you use a thread instead of a task in C#, and why or why not?”
What is Task.Run and how is it different from async/await?
Asked in 3 of 95 interviews · last asked Oct 1 · Concept · Mid-level
Show answer
Task.Run queues work on the thread pool and returns a Task. async and await let a method wait for a task without blocking the calling thread; they do not automatically move work to another thread. Use Task.Run for CPU-heavy work to keep a UI responsive. For network calls, await the asynchronous API directly.
- Synchronous execution keeps the calling thread busy or blocked until the operation finishes.
- Task.Run moves work to a thread-pool thread; it does not make that work inherently faster.
- True asynchronous I/O does not need a thread blocked while waiting for the operation.
- Wrapping synchronous I/O in Task.Run still blocks a thread-pool thread.
What the interviewer checks: The interviewer checks whether you can separate thread-pool execution from asynchronous waiting and choose correctly for CPU or I/O work.
Other ways it was asked
- “When would you use Task.Run, and when would you use async and await directly? What is the key difference, particularly for an I/O-bound operation such as a network call?”
- “What is the difference between Task.Run and standard synchronous execution in .NET?”
What happens behind the scenes when you await an operation in C#?
Asked in 3 of 95 interviews · last asked Sep 1 · Concept · Senior
Show answer
The compiler turns an async method into a state machine. At each await, it checks whether the operation is complete. If not, it saves the method's state, registers a continuation, and returns control to the caller without blocking the thread. When the operation completes, the method resumes and gets the result or throws the exception.
- An already completed operation continues synchronously, without suspending the method.
- Await does not create a thread or automatically move work to another thread.
- Await normally captures a synchronization context when present; ASP.NET Core has none by default.
- Async I/O frees threads while waiting, helping servers handle more concurrent requests.
What the interviewer checks: The interviewer checks whether you understand suspension, continuations, and why asynchronous waiting does not require a blocked thread.
Other ways it was asked
- “What happens internally when you use `await` in C#, and why is it useful?”
- “What happens behind the scenes when you use async and await in ASP.NET Core?”
- “What happens under the hood when you write `await` in C#?”
Why can Task.Run be an anti-pattern in server code, and what should you use instead?
Asked in 2 of 95 interviews · last asked May 16 · Scenario · Senior
Other ways it was asked
- “Can you describe a scenario where using Task.Run is an anti-pattern in server code, and explain what you would do instead?”
- “Can you describe a scenario where using Task.Run is an anti-pattern in server code?”
- “What should you use instead of Task.Run in server code when it is an anti-pattern, and why?”
How do async deadlocks happen in .NET, and how do you prevent them in libraries and ASP.NET Core?
Asked in 2 of 95 interviews · last asked Jun 11 · Concept · Mid-level
Other ways it was asked
- “How do you reason about async/await deadlocks in .NET, and what patterns do you implement to prevent them in library code versus ASP.NET Core request pipelines?”
- “How can async/await and Task-based programming help avoid deadlocks in C#?”
How would you diagnose and fix blocking and ThreadPool starvation in an ASP.NET Core application?
Asked in 2 of 95 interviews · last asked Sep 18 · Scenario · Senior
Other ways it was asked
- “Your ASP.NET Core API shows intermittent latency spikes traced to sync-over-async and thread pool starvation. How would you diagnose the issue and redesign the execution flow?”
- “Where would you start diagnosing rising latency and ThreadPool queue length in ASP.NET Core when CPU utilization is low?”
- “How would you confirm that threads are blocked or stalled in an ASP.NET application?”
What happens when you use Task.Result or Wait instead of awaiting an asynchronous operation?
Asked in 2 of 95 interviews · last asked Oct 10 · Concept · Mid-level
Other ways it was asked
- “In .NET, what does Task.Result do, and should it be used to retrieve a result from an asynchronous operation?”
- “What is the impact of using `.Wait()` or `.Result` with asynchronous tasks?”
Can a C# async method omit await, and how does it execute?
Asked in 2 of 95 interviews · last asked Oct 16 · Concept · Mid-level
Other ways it was asked
- “In an async method, is it mandatory to use the await keyword?”
- “If we declare a method async but do not use await, will it work synchronously or asynchronously?”
How does exception handling differ between async Task and async void methods in C#?
Asked once · last asked May 11 · Concept · Senior
Does .NET provide a synchronization context by default?
Asked once · last asked Jan 28 · Concept · Senior
What is a cancellation token in .NET, and why is it needed?
Asked once · last asked Jan 28 · Concept · Mid-level
When would you choose ValueTask over Task, and what potential pitfalls are there?
Asked once · last asked Mar 16 · Concept · Senior
Why do C# async methods typically return Task?
Asked once · last asked May 11 · Concept · Mid-level
Why should you generally avoid async void methods in C#?
Asked once · last asked May 11 · Concept · Mid-level
Other ways it was asked
- “What is the main reason you should never use an async void method?”
What performance and exception-handling drawbacks can arise from using Task.Run in server code, including context-switching overhead?
Asked once · last asked May 16 · Concept · Mid-level
What is the difference between a foreground thread and a background thread in C#, and what happens when the main thread completes while other threads are still running?
Asked once · last asked Jun 17 · Concept · Mid-level
What is a thread pool in .NET, and what does it offer over manually creating threads?
Asked once · last asked Jun 17 · Concept · Mid-level
How can you set thread priority in C#, and does setting a higher priority guarantee that a thread will execute before lower-priority threads?
Asked once · last asked Jun 17 · Concept · Mid-level
What is thread-local storage in C#, and in what scenario would it be beneficial in a multithreaded application?
Asked once · last asked Jun 17 · Concept · Mid-level
Can you explain how the lock statement works in C# and what it does to ensure thread safety?
Asked once · last asked Jun 19 · Concept · Mid-level
How does a semaphore differ from a mutex in terms of thread synchronization in C#?
Asked once · last asked Jun 19 · Concept · Mid-level
What are the benefits of using ReaderWriterLockSlim over a simple lock statement, especially for read-heavy operations?
Asked once · last asked Jun 19 · Concept · Senior
Can you explain the role of Interlocked methods in thread-safe operations? When would you use them instead of a lock statement?
Asked once · last asked Jun 19 · Concept · Senior
In what situations would you choose SpinLock or SpinWait over traditional locks in C#?
Asked once · last asked Jun 19 · Concept · Senior
Can you explain how Monitor.Wait and Monitor.Pulse work together to implement condition variables in C#? What problem do they solve?
Asked once · last asked Jun 19 · Concept · Senior
What is the Task Parallel Library, and why would you choose to use it in your C# applications?
Asked once · last asked Jun 20 · Concept · Mid-level
Other ways it was asked
- “What advantages does the Task Parallel Library offer over traditional threading approaches, such as manually creating thread objects?”
In C#, what are the different ways to create and start a task using the Task class?
Asked once · last asked Jun 20 · Concept · Junior
What are continuation tasks, and can you give a scenario where you would use them?
Asked once · last asked Jun 20 · Concept · Mid-level
How would you cancel a running task in the Task Parallel Library, and what class or mechanism would you use to signal cancellation?
Asked once · last asked Jun 20 · Concept · Mid-level
What is the difference between Parallel.For and Parallel.ForEach, and when would you choose one over the other?
Asked once · last asked Jun 20 · Concept · Mid-level
What happens when multiple tasks throw exceptions concurrently in the Task Parallel Library, and how does it help you handle those exceptions?
Asked once · last asked Jun 20 · Concept · Mid-level
How can you use the Task class to coordinate a process that launches several tasks and continues when any one of them completes?
Asked once · last asked Jun 20 · Scenario · Mid-level
How might deadlocks occur when working with tasks in the Task Parallel Library, and what strategies can you use to avoid them?
Asked once · last asked Jun 20 · Scenario · Senior
What does a Task represent in C#, and what is the difference between Task and Task<T>?
Asked once · last asked Jun 21 · Concept · Mid-level
How would you handle exceptions that occur in an asynchronous method using async and await?
Asked once · last asked Jun 21 · Scenario · Mid-level
Why is async void generally discouraged in C#, and when would it be appropriate to use it?
Asked once · last asked Jun 21 · Concept · Mid-level
How would you implement progress reporting in an async method for a long-running asynchronous operation?
Asked once · last asked Jun 21 · Scenario · Mid-level
What is IAsyncEnumerable in C#, what is it used for, and how does it differ from IEnumerable?
Asked once · last asked Jun 21 · Concept · Mid-level
How do you decide between Task.Run and a dedicated thread or the thread pool for background work in a server application?
Asked once · last asked Aug 4 · Scenario · Senior
What happens when you block on async code in ASP.NET, such as calling Result or Wait, and why can it cause deadlocks?
Asked once · last asked Aug 4 · Concept · Senior
What problem does async/await solve in C#, and why not just use threads instead?
Asked once · last asked Aug 6 · Concept · Mid-level
When a thread hits an await expression, where does execution go?
Asked once · last asked Aug 6 · Concept · Mid-level
How do you perform asynchronous operations in Unity?
Asked once · last asked Sep 8 · Concept · Senior
What is a state machine in the context of async/await and Task in .NET?
Asked once · last asked Sep 10 · Concept · Senior
Why should external HTTP calls be fully asynchronous in ASP.NET Core under load?
Asked once · last asked Sep 18 · Concept · Mid-level
Why should you propagate a CancellationToken through the entire chain of asynchronous calls?
Asked once · last asked Sep 18 · Concept · Mid-level
In an ASP.NET Core endpoint that queries a database, calls an external service, and publishes to Azure Service Bus, how would you handle a client disconnect, including where to propagate CancellationToken and where to prevent cancellation?
Asked once · last asked Sep 23 · Design · Senior
Other ways it was asked
- “Imagine an ASP.NET Core API endpoint that queries a database, calls an external service, and then publishes to Azure Service Bus. The client disconnects halfway through. How would you design cancellation handling through that flow? Where would you use CancellationToken, and where would you not allow cancellation?”
In C#, what happens when you await an operation? Does it create a new thread, and what problems can occur with .Result or .Wait()?
Asked once · last asked Sep 25 · Concept · Mid-level
Can you explain how a deadlock can happen when using .Result or .Wait() in C#, with a concrete example?
Asked once · last asked Sep 25 · Concept · Senior
How would you implement bounded concurrency in C#?
Asked once · last asked Sep 25 · Concept · Senior
In .NET, how do threading and memory usage differ between synchronous code and code using async/await?
Asked once · last asked Sep 29 · Concept · Senior
What are the risks of using .Result in legacy code, and is it a good or bad practice?
Asked once · last asked Sep 29 · Concept · Senior
What happens if you wrap an I/O-bound task inside Task.Run? Does it help?
Asked once · last asked Sep 29 · Concept · Senior
What is the difference between Thread.Sleep and Task.Delay?
Asked once · last asked Sep 29 · Concept · Mid-level
What are lock, SemaphoreSlim, and Parallel.ForEach used for?
Asked once · last asked Sep 29 · Concept · Senior
If tasks two and three both throw exceptions inside Task.WhenAll, what does the catch block receive when you await it?
Asked once · last asked Sep 29 · Concept · Senior
How can you catch or inspect exceptions from all failed tasks when using Task.WhenAll?
Asked once · last asked Sep 29 · Concept · Senior
What is the difference between using async/await and explicitly creating and starting a thread in .NET?
Asked once · last asked Oct 5 · Concept · Mid-level
What does the ThreadStatic attribute do in C#?
Asked once · last asked Oct 5 · Concept · Mid-level
What does the lock keyword do in C#?
Asked once · last asked Oct 5 · Concept · Mid-level
What is the difference between lock and mutex?
Asked once · last asked Oct 5 · Concept · Mid-level
Why was Task introduced in .NET when threads already existed, and what is it used for?
Asked once · last asked Oct 6 · Concept · Mid-level
Other ways it was asked
- “Why did Microsoft introduce Task when threads already existed, and what is Task used for?”
Is it good practice to use async/await in nearly every method in a long call chain in a classic ASP.NET application?
Asked once · last asked Oct 6 · Concept · Senior
What is the purpose of using threads in C# programming?
Asked once · last asked Jun 17 · Concept · Junior
How would you create and start a thread in C#? What is the basic syntax?
Asked once · last asked Jun 17 · Write code · Junior
What does a CancellationToken do in .NET?
Asked once · last asked Sep 18 · Concept · Junior
More C# and .NET interview questions
- All C# and .NET interview questions
- C# Language and OOP Interview Questions
- ASP.NET Core MVC and Web API Interview Questions
How this list is made
Every question here was asked by a real interviewer in a real job interview that a candidate ran MeetAssist in. After the call, the interviewer's questions are pulled from the transcript. Practice sessions, tests, exams and anything that was not a job interview are dropped.
Questions are rewritten so they make sense on their own: names of people, employers and clients are removed, and speech-to-text mistakes are fixed. Small talk, logistics and questions about one candidate's own résumé are left out. Rephrasings of the same question are merged, and the count is the number of different interviews it came up in.
The interviews come from candidates who use MeetAssist, so they lean towards software, data and AI roles: the shares describe these interviews, not every C# and .NET interview. Answers to the most asked questions are written and checked by an editor; a "common mistake" is shown only when reviews of real answers in these interviews show it, with the count.
95 interviews, 54 candidates, Jan 2026 to Oct 2026. Updated every month with new interviews.
Or add the Chrome extension