.NET interview preparation - aniketmulmule/web_Project GitHub Wiki

<style> </style>

With 8 years of experience in C# and .NET, interviewers will expect depth, clarity, and practical application of core C# concepts—not just syntax. You’ll likely be asked about real-world usage, design patterns, and performance tuning.

Here’s a focused list of C# concepts frequently asked at senior-level interviews:


1. OOP Principles in C# (Advanced Understanding)

  • Inheritance, Polymorphism, Encapsulation, Abstraction
  • Difference between interface vs abstract class
  • Access modifiers (private, protected, internal, protected internal)
  • sealed, readonly, const, static – when and why to use
  • Real-world OOP design examples (not just theory)

2. Delegates, Events, and Func/Action/Predicate

  • What is a delegate? How is it different from a function pointer?
  • Event-driven programming (event keyword, custom event handlers)
  • Multicast delegates
  • Use of Action<T>, Func<T>, Predicate<T>

Common Q: How do delegates enable loose coupling?


3. LINQ & Lambda Expressions

  • LINQ to Objects vs LINQ to Entities
  • Deferred vs Immediate Execution
  • GroupBy, SelectMany, Any, All, Aggregate
  • Expression trees and method vs query syntax

Common Q: What's the difference between Select and SelectMany?


4. Exception Handling and Best Practices

  • try-catch-finally, custom exceptions
  • when filters
  • When to catch vs rethrow (throw; vs throw ex;)
  • Global exception handling (ASP.NET Core middleware)

5. Async/Await, Task, Parallelism

  • async/await, Task, Task<T>, ValueTask
  • Difference between Task.Run() and async method
  • ConfigureAwait(false) use cases
  • Thread vs Task vs async
  • Deadlocks and SynchronizationContext

Common Q: What causes deadlocks in async code?


6. Generics

  • Generic constraints (where T : class, etc.)
  • Covariance and contravariance (out, in)
  • Use of default(T), Activator.CreateInstance<T>()

7. Memory Management & Garbage Collection

  • How GC works in .NET
  • Large Object Heap, Gen0/1/2 collections
  • IDisposable, using, finalizers
  • Memory leaks in .NET (via events, long-lived references)

8. Design Patterns (C# Implementation)

  • Singleton, Factory, Repository, Dependency Injection
  • Adapter, Strategy, Decorator, Mediator
  • How to implement and when to apply

9. Reflection & Dynamic Features

  • Using Type, PropertyInfo, MethodInfo
  • dynamic vs object
  • Use cases for Activator, Assembly.Load

10. Nullable Reference Types & Null Handling

  • ?, ??, ??=, null-forgiving (!)
  • How nullable reference types help prevent runtime null exceptions

11. Records, Tuples, and Value Types (Modern C#)

  • record vs class vs struct
  • with expressions
  • Deconstruction
  • Use of ValueTuple

12. C# 9/10/11 Features

  • Top-level statements
  • Pattern matching (newer enhancements)
  • init properties
  • File-scoped namespaces
  • Static local functions
  • Required members (C# 11+)

13. Common Pitfalls

  • Boxing/unboxing
  • Closure inside a loop
  • async void vs async Task
  • IEnumerable vs IQueryable

🧠 Bonus: Problem-Solving with C#

You may also be asked to write:

  • LINQ queries
  • Data transformation logic
  • Business rule engine (strategy pattern example)
  • Async method with cancellation
  • Custom equality comparer or IComparable

📘 Study Resources

Type Resource
Docs https://learn.microsoft.com/en-us/dotnet/csharp/
Book C# in Depth by Jon Skeet
Blog https://code-maze.com/category/csharp/
Practice https://exercism.org/tracks/csharp or LeetCode (C# tag)

Would you like a PDF cheat sheet or flashcard deck for quick revision before interviews?

 

⚠️ **GitHub.com Fallback** ⚠️