C# Interview

Advanced Async, Parallelism & Threading

C# interview questions covering advanced async, parallelism & threading.

10 Questions Filter by level

Interview questions

Open a question for the full answer, code and interview guidance.

10 Results
141
SeniorAdvanced

What is the difference between concurrency and parallelism?

Concurrency means multiple operations can make progress during overlapping periods of time. They do not necessarily execute at exactly the same instant.

142
SeniorAdvanced

What is the difference between I/O-bound and CPU-bound work?

I/O-bound work spends most of its time waiting for external resources such as databases, files, HTTP services, or network operations. async/await is normally the appropriate approach because the thread does not need to remain blocked while waiting.

143
SeniorAdvanced

What is ConfigureAwait in C#?

ConfigureAwait controls whether an await should attempt to continue on the captured synchronization context.

144
SeniorAdvanced

What is ValueTask<T>, and when should it be used?

ValueTask<T> is an awaitable value type that can represent either an already available result or an asynchronous operation.

145
SeniorAdvanced

What is IAsyncEnumerable<T> in C#?

IAsyncEnumerable<T> represents an asynchronous stream of values. Instead of waiting for an entire result set before processing begins, values can be produced and consumed asynchronously over time.

146
SeniorAdvanced

What is the thread pool in .NET?

The .NET thread pool maintains reusable worker threads for executing short-lived work. Tasks, timers, asynchronous continuations, and many framework operations use thread-pool infrastructure.

147
SeniorAdvanced

What is thread-pool starvation?

Thread-pool starvation occurs when available worker threads are occupied or blocked faster than the runtime can make threads available for new work.

148
SeniorAdvanced

What is Parallel.ForEach, and when should it be used?

Parallel.ForEach executes loop iterations potentially in parallel using multiple threads. It is designed mainly for CPU-bound work where iterations are independent.

149
SeniorAdvanced

What is Parallel.ForEachAsync?

Parallel.ForEachAsync is an asynchronous parallel loop available in modern .NET. It allows each iteration to await asynchronous work while controlling the degree of parallelism.

150
SeniorAdvanced

What are common async/await mistakes in C#?

Common mistakes include blocking on tasks with .Result or .Wait(), using async void for methods other than event handlers, forgetting to await tasks, starting excessive concurrent operations, and ignoring cancellation.