C#

0%

    Type System & Memory Model

    • What is the difference between const and readonly? When is the value of each evaluated?

      Junior
    • What is the difference between a value type and a reference type in C#?

      Junior
    • What is the difference between the stack and the heap, and what gets stored on each?

      Junior
    • Explain the difference between a struct and a class. When would you choose one over the other?

      Mid
    • What is boxing and unboxing, and why is it generally considered a performance bottleneck?

      Mid
    • Can a struct implement an interface? Can it inherit from a class?

      Mid

    CLR & Runtime Fundamentals

    • What is the difference between managed and unmanaged code?

      Junior
    • What is the Common Language Runtime (CLR), and what are its primary responsibilities?

      Junior
    • What is the difference between C#, .NET, and the CLR (Common Language Runtime)?

      Junior
    • What is an 'Assembly' in .NET, and what is the difference between a Private and a Shared Assembly?

      Mid
    • Explain the role of the Just-In-Time (JIT) compiler in the .NET execution process.

      Mid
    • What are Attributes in C#, and how can they be retrieved at runtime?

      Mid
    • Explain the difference between JIT (Just-In-Time) compilation and AOT (Ahead-Of-Time) compilation. What are the tradeoffs of Native AOT?

      Senior
    • What is the role of the Global Assembly Cache (GAC) in modern .NET (Core) vs. .NET Framework?

      Senior

    Object Oriented Design

    • What are the different access modifiers in C#, and what does protected internal specifically mean?

      Junior
    • Explain the difference between method overriding and method overloading.

      Junior
    • What are the different types of classes in C# (abstract, static, partial, sealed)?

      Junior
    • Explain the difference between an interface and an abstract class. When is one preferred over the other?

      Mid
    • What is the purpose of the sealed keyword? Why might you seal a class for performance reasons?

      Mid
    • What are extension methods, and how do they achieve polymorphism without inheritance?

      Mid
    • What is a static constructor, and when is it executed?

      Mid
    • Explain the 'Diamond Problem' and how C# handles multiple inheritance through interfaces.

      Senior
    • How do Default Interface Methods work, and why were they added to the language?

      Senior

    Core Language Operators & Conversions

    • What is the difference between the is and as operators?

      Junior
    • Explain the difference between ref, out, and in parameters. Why would you use in for performance?

      Mid
    • Explain the difference between var, dynamic, and object.

      Mid
    • What is the difference between == and the Equals() method in C#?

      Mid
    • What is operator overloading, and what are the rules and limitations around it?

      Mid
    • How do implicit and explicit conversion operators work in C#?

      Mid

    Strings Enums & Tuples

    • What is the difference between String and StringBuilder in terms of memory allocation?

      Junior
    • How are enums represented in C#, and what is the [Flags] attribute used for?

      Junior
    • Why are strings immutable in C#, and what is string interning?

      Mid
    • What is the difference between a Tuple and a ValueTuple?

      Mid

    LINQ & Iterators

    • What is the difference between First, FirstOrDefault, Single, and SingleOrDefault in LINQ?

      Junior
    • Explain the concept of Deferred Execution in LINQ. Why is it important for performance?

      Mid
    • What is the difference between IEnumerable<T> and IQueryable<T>? When would you choose one over the other?

      Mid
    • When would you use a yield return statement?

      Mid
    • What is the difference between Array.Sort() and LINQ's .OrderBy()?

      Mid
    • What is the difference between IEnumerable<T>, ICollection<T>, and IQueryable<T>?

      Mid
    • What is the difference between Select and SelectMany?

      Mid
    • Explain the yield keyword and how it creates an iterator state machine.

      Mid
    • What is the difference between yield return and returning a concrete List<T>?

      Mid

    Language Features & DI

    • Explain the null-coalescing (??) and null-conditional (?.) operators and when you'd use them.

      Junior
    • What are the benefits of generics, and how do they differ from using object?

      Junior
    • What is the difference between Func, Action, and Predicate delegates?

      Junior
    • What is a delegate, and how does it differ from an event?

      Mid
    • What are the different dependency injection lifetimes in .NET?

      Mid
    • Explain the concept of Inversion of Control (IoC) and how it is supported natively in the .NET Base Class Library.

      Mid
    • What are Nullable Reference Types, and what problem do they solve?

      Mid
    • What is Nullable<T> (a nullable value type), and how does it work under the hood?

      Mid
    • What are generic constraints (the where clause), and why would you use them?

      Mid
    • What is Variance (Covariance and Contravariance) in C# Generics? Why can't you pass a List<string> into a method expecting a List<object>?

      Senior
    • What are Interceptors in C# 12, and what is their primary use case in source generators?

      Senior
    • What are Source Generators, and how do they differ from Reflection in terms of performance and timing?

      Senior
    • What is a closure in C#, and how does variable capture in a lambda work?

      Senior

    Collections & Data Structures

    • What is the difference between IEnumerable, ICollection, and IList?

      Mid
    • How does a List<T> work internally when it reaches its capacity? What is the Big-O complexity of adding an item?

      Mid
    • What are thread-safe collections like ConcurrentDictionary, and when would you use them?

      Mid
    • How does a Dictionary<K, V> work internally? What happens during a hash collision?

      Senior
    • What are Frozen Collections (introduced in .NET 8), and when would you use them over a standard Dictionary or HashSet?

      Senior
    • What is a WeakReference, and when would you use one?

      Senior

    Equality Comparison & Ordering

    • Explain how try/catch/finally works and what exception filters (when clauses) add.

      Junior
    • Explain the difference between throw and throw ex. Why does it matter for debugging?

      Mid
    • What is the relationship between Equals() and GetHashCode(), and why must you override both together?

      Mid
    • What are best practices for creating and throwing custom exceptions in C#?

      Mid
    • What is the difference between IComparable and IComparer, and when would you use each?

      Mid

    Async & Concurrency

    • Explain the difference between a Thread, a Task, and a Thread Pool thread.

      Mid
    • What is the difference between Task.Wait() and await Task?

      Mid
    • What is the risk of using .Result or .Wait() on an asynchronous task?

      Mid
    • How does a CancellationToken work to stop an asynchronous operation?

      Mid
    • Explain how the async and await keywords work under the hood. What is the state machine?

      Senior
    • What is the difference between a Task and a ValueTask, and when should you prefer one over the other?

      Senior
    • Explain the purpose of ConfigureAwait(false). When is it necessary, and when should it be avoided?

      Senior
    • What is the difference between Task.Run() and Task.Factory.StartNew()?

      Senior
    • What is a deadlock in an asynchronous context, and how can you prevent it?

      Senior
    • What is the new System.Threading.Lock type in .NET 9, and how does it differ from lock(obj)?

      Senior
    • Why is async void generally considered a bad practice, and what are the rare exceptions where it is acceptable?

      Senior
    • Explain IAsyncEnumerable<T> and how it differs from a standard Task<IEnumerable<T>>.

      Senior
    • How does the lock statement work internally? What is the difference between lock and Monitor?

      Senior
    • What does the volatile keyword do, and when is it needed?

      Senior
    • What is the difference between lock, Mutex, and SemaphoreSlim for synchronization?

      Senior

    Memory Management & GC

    • Explain the 'using' statement. What happens to the object when the block execution finishes?

      Junior
    • What is the difference between a Finalizer and the IDisposable interface? When would you use one over the other?

      Mid
    • What is a memory leak in a managed environment like C#, and how can it happen?

      Mid
    • Explain the IDisposable interface and the using statement. Why is it necessary even with a Garbage Collector?

      Mid
    • How does the .NET Garbage Collector work? Explain the concept of Generations (0, 1, and 2).

      Senior
    • What is the Large Object Heap (LOH), and why is it handled differently by the GC?

      Senior
    • What is Reflection, and what are the performance implications of using it extensively?

      Senior
    • What are Span<T> and Memory<T>, and what specific problem do they solve regarding memory allocation?

      Senior
    • What is 'pinning' an object in memory, and when would you need to do it?

      Senior
    • When would you use GC.Collect(), and what are the trade-offs of calling it manually?

      Senior
    • Explain the difference between the Small Object Heap (SOH) and the Large Object Heap (LOH). Why is LOH fragmentation a concern?

      Senior
    • Explain the concept of ref struct like Span<T>. Why can it only exist on the stack, and what are its limitations?

      Senior

    Modern Csharp Language Features

    • What are primary constructors in C# 12, and how do they differ from traditional constructors?

      Mid
    • What are C# Records, and how do they differ from standard classes?

      Mid
    • What are Collection Expressions in C# 12, and how do they provide a unified syntax for different collection types?

      Mid
    • Explain pattern matching in C# and when you would use it over a standard if/else or switch block.

      Mid
    • What are required members (introduced in C# 11), and what problem do they solve for object initialization?

      Mid
    • What is Pattern Matching in C#, and how has it evolved in recent versions?

      Mid
    • What is the Spread Operator in C# collection expressions, and how does it differ from traditional concatenation?

      Mid
    • Explain the 'params collections' feature in C# 13. How does it improve over the old params array?

      Senior
    • Explain the field keyword introduced in C# 13 and how it simplifies property backing fields.

      Senior