📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

πŸ“š .NET Interview Questions

377 questions for senior .NET engineer interviews, each with a 30-second answer, the full answer, a deep dive, the follow-ups interviewers ask next, and real-world production problems.

Async Advanced

SynchronizationContext, ConfigureAwait, cancellation, timeouts, async streams, Channels, TPL Dataflow, PLINQ and Parallel.ForEachAsync.

  1. What is a SynchronizationContext, which .NET app models have one, and how does it cause the classic async deadlock?

    SynchronizationContext Post and Send, UI and legacy ASP.NET contexts, ASP.NET Core having none, and the blocking-on-async deadlock.

    Senior Debugging Async Advanced Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  2. What does ConfigureAwait(false) do, when should you use it, and what are ConfigureAwaitOptions in .NET 8+?

    Context capture, library versus application code, the already-completed caveat, ASP.NET Core relevance, CA2007 and ConfigureAwaitOptions.

    Mid-Level Theory Async Advanced Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  3. How does cooperative cancellation with CancellationToken work in .NET, and how do you design APIs that support it?

    CancellationTokenSource and token, ThrowIfCancellationRequested, Register, OperationCanceledException, RequestAborted in ASP.NET Core, disposal and where not to cancel.

    Mid-Level Coding Async Advanced Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  4. What are linked cancellation tokens, and how do you combine a caller's token with your own timeout safely?

    CreateLinkedTokenSource, disposal to avoid leaks, telling which source fired, and combining request, shutdown and timeout cancellation.

    Senior Coding Async Advanced Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  5. How do you handle timeouts correctly in async .NET code, from HttpClient to ASP.NET Core requests?

    CancelAfter, WaitAsync, HttpClient.Timeout, resilience handlers, ASP.NET Core request timeouts middleware, TimeProvider and layered timeout budgets.

    Senior RealWorldScenario Async Advanced Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  6. What are async streams and IAsyncEnumerable of T? How do you produce, consume and cancel them?

    Async iterators with yield return and await, await foreach, EnumeratorCancellation, ConfigureAwait, LINQ over async streams in .NET 10, EF Core and ASP.NET Core streaming.

    Senior Coding Async Advanced Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  7. What are System.Threading.Channels, and how would you build a bounded producer/consumer pipeline with them?

    Bounded and unbounded channels, full modes, single reader and writer options, completion, ReadAllAsync and backpressure in background processing.

    Senior Coding Async Advanced Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world
  8. What is TPL Dataflow, and when would you choose it over Channels or Parallel.ForEachAsync?

    Dataflow blocks, linking with completion propagation, MaxDegreeOfParallelism, BoundedCapacity, SendAsync versus Post, batching and when it is the right tool.

    Senior Architecture Async Advanced Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  9. What is PLINQ, when does AsParallel help, and when does it make things worse?

    Parallel LINQ partitioning, degree of parallelism, ordering, merge options, cancellation, exceptions, and why it is for CPU-bound work only.

    Mid-Level Theory Async Advanced Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  10. How does Parallel.ForEachAsync work, and how does it compare with Task.WhenAll and SemaphoreSlim for concurrent I/O?

    Parallel.ForEachAsync in .NET 6+, MaxDegreeOfParallelism defaults, cancellation and exception behaviour, collecting results, Parallel.ForAsync and alternatives.

    Mid-Level Coding Async Advanced Β· πŸ”— 3 follow-ups Β· πŸ›  1 real-world

🌐 Sangam's Webring

βͺ Previous 🏠 Main Next ⏩
πŸ’¬ Chat with me