LearnThatStack Ace your next interview
Backend Development

C#.

Start free Change topic Change
Practice · Questions

All questions

Showing of 112
Beginner 37
01

Explain the difference between value types and reference types in C#.

Visual

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
Visual

A value type holds its data directly, while a reference type holds a reference to an object on the heap. Assigning a value type copies the whole value, and assigning a reference type copies only the reference.

Changing one copy of a value type leaves the other copy alone. Two reference-type variables can point at the same object, so a change made through one shows up through the other.

  • Value types include int, bool and char. Every struct and enum is a value type too.
  • Reference types include any class and string. Arrays and delegates are reference types too.

Value types default to zero, false or null in every field. Reference types default to null.

A local value-type variable usually sits on the stack, but a value-type field lives inside its containing object, on the heap.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

02

What is the difference between const and readonly in C#?

Visual

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
Visual

A const is fixed at compile time, while a readonly field is fixed at run time, when its object or type is initialized.

  • A const must be initialized where it is declared and never changes. It is implicitly static and holds only primitive types, string literals or null.
  • A readonly field is set in its declaration or a constructor, so each instance can get its own value. It can be instance or static and hold any type.

For a reference type, readonly fixes only the reference. The object it points to can still change.

The compiler copies a const value into every caller, so changing it means recompiling those callers. A readonly value is read at run time. Use const for values that never change between versions, and readonly for values known only at run time.

public class Example
{
    const int MAX_SIZE = 100;           // Compile-time constant
    readonly DateTime createdDate;      // Runtime constant
    public Example()
    {
        createdDate = DateTime.Now;     // Can set in constructor
    }
}
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

03

What are namespaces in C# and why are they important?

Visual

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
Visual

A namespace groups related types under a name, such as MyCompany.DataAccess, so two types can share a name without clashing.

Namespaces are hierarchical. That lets you organize a codebase by area and keeps type names short and readable. Code refers to a type by its full name, or imports the namespace with a using directive.

namespace MyCompany.DataAccess
{
    public class DatabaseConnection { }
}
namespace MyCompany.UI
{
    public class DatabaseConnection { } // Same name, different namespace
}

Namespaces only affect names. They do not control loading, because the runtime loads code by assembly, and one assembly can hold many namespaces.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

04

What is the var keyword and when should you use it?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

var declares an implicitly typed local variable, whose type the compiler infers from the initializer. The variable is still strongly typed, and its type is fixed at compile time.

It only works for local variables initialized where they are declared. Use it when the type is obvious from the right side, like new List<int>(). It is required for anonymous types, which have no name you can write. It also shortens LINQ queries with long type names. Avoid it when the type is not clear from the code.

var number = 42;           // int
var text = "Hello";        // string
var list = new List<int>(); // List<int>
// Required for anonymous types
var person = new { Name = "John", Age = 30 };
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

05

Explain the four pillars of Object-Oriented Programming.

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Encapsulation bundles data with its methods and hides the internals, and inheritance builds a new class from an existing one to reuse its code. Polymorphism lets code use different types through one common type, and abstraction shows only the essential features.

C# has a language feature for each pillar:

  1. For encapsulation, access modifiers like private, plus properties.
  2. For inheritance, a single base class, as in class Car : Vehicle.
  3. For polymorphism, virtual and override methods and interfaces.
  4. For abstraction, abstract classes and interfaces.
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

06

Explain method overriding vs method overloading.

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Overloading gives several methods one name with different parameters, and the compiler picks one at compile time. Overriding replaces a base class method in a derived class, and the runtime picks one based on the object's actual type.

The compiler chooses an overload from the argument types, so overloading is compile-time polymorphism. Overloads can live in the same class, like the two Add methods below. The return type alone cannot tell overloads apart.

Overriding needs virtual or abstract on the base method and override in the derived class. A Shape variable holding a Circle runs Circle.GetArea, so overriding is runtime polymorphism.

Use overloads for the same operation on different inputs. Use overriding to change behavior in a subclass.

// Overloading
public class Calculator
{
    public int Add(int a, int b) { return a + b; }
    public double Add(double a, double b) { return a + b; }
}
// Overriding
public class Shape
{
    public virtual double GetArea() { return 0; }
}
public class Circle : Shape
{
    private double radius;
    public override double GetArea() { return Math.PI * radius * radius; }
}
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

07

Explain access modifiers in C#.

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Access modifiers control which code can use a type or member.

  • public is accessible from anywhere.
  • private is accessible only inside the containing class.
  • protected is accessible in the class and its derived classes.
  • internal is accessible anywhere in the same assembly.
  • protected internal is accessible in the same assembly, or from derived classes in any assembly.
  • private protected is accessible only from derived classes in the same assembly.

Members of a class default to private, and top-level types default to internal. Pick the most restrictive one that works.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

08

What are constructors and their types in C#?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

A constructor is a special method that runs when an object is created and sets up its state. It has the class name and no return type.

  • A default constructor takes no parameters. The compiler adds one only when the class declares no constructor.
  • A parameterized constructor takes values to initialize the object.
  • A static constructor initializes static members. It runs once per type, before first use.
  • A private constructor stops outside code from creating instances, as in a singleton.
  • C# has no built-in copy constructor, so you write one yourself.
public class Person
{
    // Parameterized constructor
    public Person(string name, int age)
    {
        Name = name;
        Age = age;
    }
    // Static constructor
    static Person()
    {
        // Initialize static members
    }
}
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

09

What are nullable types and how do you use them?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

A nullable value type, written int?, lets a value type hold null as well as its normal values. It is shorthand for Nullable<int>, a struct with a HasValue flag and a Value property.

It fits data that can be missing, like a database column that allows NULL or an optional form field.

Check HasValue before reading Value, because reading Value when it holds nothing throws an InvalidOperationException. The ?? operator supplies a fallback instead, and GetValueOrDefault() returns the type's default.

int? nullableInt = null;
bool? nullableBool = null;
// Checking for null
if (nullableInt.HasValue)
{
    int value = nullableInt.Value;
}
// Null coalescing operator
int result = nullableInt ?? 0; // Use 0 if null

Do not confuse these with nullable reference types like string?, which are compile-time annotations only.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

10

Explain the difference between string and StringBuilder.

Visual

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
Visual

A string is immutable, so every change creates a new string object. A StringBuilder is mutable and appends into an internal buffer, so repeated changes avoid those extra objects.

Concatenating in a loop shows the cost. Each += on a string copies all the text built so far, so the total work grows with the square of the length. StringBuilder keeps one buffer and only reallocates when its capacity runs out.

Use string for a few concatenations, where the difference is too small to matter. Use StringBuilder when you build text in a loop or across many steps.

Immutability also makes a string safe to share across threads. A StringBuilder is not thread-safe, so one thread should own it.

// Inefficient - creates multiple string objects
string result = "";
for (int i = 0; i < 1000; i++)
{
    result += i.ToString(); // Creates new string each time
}
// Efficient - uses internal buffer
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 1000; i++)
{
    sb.Append(i); // Modifies existing buffer
}
string result2 = sb.ToString();
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

11

Explain implicit and explicit type conversion.

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

An implicit conversion happens automatically because the compiler knows it is safe, like int to double. An explicit conversion needs a cast, like (int)largeValue, because the value may not fit.

Implicit conversions go from a smaller type to a larger one, so the value never overflows. They are not always exact, though. Converting int to float or long to double can lose precision, while keeping the magnitude.

Explicit conversions go from larger to smaller types, or between types that are not directly compatible. They can lose data, as when a cast drops the decimal part of a double. In a checked context they can also throw an OverflowException.

The Convert class handles conversions a cast cannot do, like turning the string "123" into an int.

// Implicit conversion
int intValue = 123;
double doubleValue = intValue; // Automatic conversion
// Explicit conversion
double largeValue = 123.456;
int smallValue = (int)largeValue; // Manual cast, loses decimal part
// Using Convert class
string numberString = "123";
int convertedValue = Convert.ToInt32(numberString);
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

12

What is the difference between Parse() and TryParse() methods?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Parse() returns the value and throws on invalid input, while TryParse() returns a bool for success and passes the value out through an out parameter.

Use Parse when invalid input means a bug, such as data your own code produced. Use TryParse for input you do not control, like user input or file contents. It avoids the cost of throwing and catching an exception for a failure you expect.

int.Parse throws a FormatException for text that is not a number, and an OverflowException when the number is out of range. On failure, TryParse sets the out value to its default, which is 0 for int. Most built-in value types have both methods, including DateTime and Guid.

// Parse - throws exception on failure
try
{
    int value1 = int.Parse("123");
    int value2 = int.Parse("abc"); // Throws FormatException
}
catch (FormatException ex) { }
// TryParse - safe conversion
if (int.TryParse("123", out int value3))
{
    // Conversion successful
}
else
{
    // Conversion failed, value3 is 0
}
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

13

Explain the difference between Array, ArrayList, and List<T>.

Visual

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain
Visual

An array has a fixed size, while ArrayList and List<T> grow as you add items. Arrays and List<T> are type-safe, and ArrayList is not.

ArrayList stores everything as object. Adding an int boxes it, and nothing stops you mixing strings and numbers in one list. The mistake shows up at run time as a failed cast. List<T> is generic, so the compiler checks every Add, and at run time it stores value types without boxing.

Array ArrayList List<T>
Size Fixed Grows Grows
Type-safe Yes No Yes
Boxes value types No Yes No
Use it for Fixed-size data, best performance Legacy code only Most collections

All three use zero-based indexing. Prefer List<T> in new code, and an array when the size is known and fixed.

// Array
int[] array = new int[5];
// ArrayList (avoid)
ArrayList arrayList = new ArrayList();
arrayList.Add(1);       // Boxing occurs
arrayList.Add("text");  // No compile-time type checking
// List<T> (preferred)
List<int> list = new List<int>();
list.Add(1);           // No boxing
// list.Add("text");   // Compile-time error
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

14

What are the different types of generic collections in C#?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

The core generic collections are List<T>, Dictionary<TKey, TValue> and HashSet<T>, with queues, stacks and sorted versions for special cases. They live in System.Collections.Generic, are type-safe, and store value types without boxing.

  • List<T> is a dynamic array, and LinkedList<T> is a doubly linked list.
  • HashSet<T> holds unique items with fast lookup, and SortedSet<T> keeps them sorted.
  • Dictionary<TKey, TValue> maps keys to values with fast lookup, and SortedDictionary<TKey, TValue> keeps the keys sorted.
  • Queue<T> is first in, first out, and Stack<T> is last in, first out.

For shared access across threads, ConcurrentDictionary<TKey, TValue> in System.Collections.Concurrent is the thread-safe dictionary.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

15

Explain the try-catch-finally block structure.

Part of Pro
16

What is LINQ and what are its benefits?

Part of Pro
17

Explain the difference between query syntax and method syntax in LINQ.

Part of Pro
18

What are lambda expressions and how are they used in LINQ?

Part of Pro
19

What is the difference between anonymous methods and lambda expressions?

Part of Pro
20

What is the difference between synchronous and asynchronous programming?

Part of Pro Visual
21

What is the difference between Task and Task<T>?

Part of Pro
22

What is the difference between stack and heap memory?

Part of Pro Visual
23

What are extension methods and how do you create them?

Part of Pro
24

Explain raw string literals in C# 11.

Part of Pro
25

Explain global using directives and file-scoped namespaces.

Part of Pro
26

Explain the differences between .NET Framework, .NET Core, and .NET 5+.

Part of Pro
27

What is the difference between ref, out, and in parameters?

Part of Pro
28

Explain anonymous types and their limitations.

Part of Pro
29

What is the params keyword and how is it used?

Part of Pro
30

Explain the using declaration vs using statement.

Part of Pro
31

Explain tuple types and deconstruction.

Part of Pro
32

What are switch expressions vs switch statements?

Part of Pro
33

How do classes and structs differ, and when should you use a struct?

Part of Pro
34

What is the difference between float, double and decimal in C#?

Part of Pro Visual
35

What is the difference between the is and as operators in C#?

Part of Pro
36

What is the difference between Thread.Sleep and Task.Delay?

Part of Pro Visual
37

Explain indexers in C#.

Part of Pro
Intermediate 64
38

Explain the concept of boxing and unboxing in C#.

Part of Pro Visual
39

Explain the difference between == operator and Equals() method.

Part of Pro Visual
40

What is the difference between abstract class and interface?

Part of Pro
41

What is the difference between virtual, override, and new keywords?

Part of Pro Visual
42

What is the difference between composition and inheritance?

Part of Pro
43

Explain the concept of sealed classes and methods.

Part of Pro
44

What is string interning in C#?

Part of Pro Visual
45

What are generics and what are their benefits?

Part of Pro
46

Explain generic constraints in C#.

Part of Pro
47

What is the difference between IEnumerable and IEnumerator?

Part of Pro Visual
48

Explain the difference between IEnumerable<T> and IQueryable<T>.

Part of Pro Visual
49

What is the difference between throw and throw ex?

Part of Pro
50

What are custom exceptions and when should you create them?

Part of Pro
51

Explain the using statement and IDisposable interface.

Part of Pro
52

What is deferred execution in LINQ?

Part of Pro Visual
53

Explain the difference between First(), FirstOrDefault(), Single(), and SingleOrDefault().

Part of Pro
54

Explain GroupBy in LINQ with an example.

Part of Pro Visual
55

What is the difference between Select and SelectMany?

Part of Pro Visual
56

Explain Join operations in LINQ.

Part of Pro Visual
57

What are delegates in C# and how do they work?

Part of Pro Visual
58

Explain the difference between Func, Action, and Predicate delegates.

Part of Pro
59

What are events and how are they different from delegates?

Part of Pro Visual
60

Explain event handling patterns in C#.

Part of Pro
61

Explain async and await keywords.

Part of Pro Visual
62

Explain ConfigureAwait(false) and when to use it.

Part of Pro Visual
63

What is the difference between Task.Run() and direct async method call?

Part of Pro Visual
64

Explain parallel programming with Task.WhenAll and Task.WhenAny.

Part of Pro Visual
65

What are the best practices for async/await?

Part of Pro
66

How does garbage collection work in C#?

Part of Pro Visual
67

What are finalizers and destructors in C#?

Part of Pro Visual
68

Explain memory leaks in C# and how to prevent them.

Part of Pro Visual
69

What is reflection in C# and when would you use it?

Part of Pro
70

Explain attributes in C# and provide examples.

Part of Pro
71

Explain partial classes and partial methods.

Part of Pro
72

What is the dynamic keyword and when should you use it?

Part of Pro
73

Explain the yield keyword and iterators.

Part of Pro Visual
74

What are nullable reference types and how do they work?

Part of Pro Visual
75

Explain records in C# and their benefits.

Part of Pro
76

What are pattern matching enhancements in modern C#?

Part of Pro
77

Explain the required keyword in C# 11.

Part of Pro
78

What are list patterns in C# 11?

Part of Pro Visual
79

What are UTF-8 string literals in C# 11?

Part of Pro
80

What are primary constructors in C#, and what are their limitations?

Part of Pro
81

What design patterns and idioms are common in C#?

Part of Pro
82

What are common debugging and testing practices in C#?

Part of Pro
83

Explain minimal APIs in .NET 6+.

Part of Pro
84

What is dependency injection and how is it implemented in .NET?

Part of Pro Visual
85

Explain threading concepts: Thread, ThreadPool, and Task.

Part of Pro
86

What are locks and synchronization in C#?

Part of Pro Visual
87

Explain the Repository and Unit of Work patterns.

Part of Pro Visual
88

What is operator overloading and how do you implement it?

Part of Pro
89

What are local functions and when would you use them?

Part of Pro Visual
90

Explain the service lifetimes in the .NET dependency injection container and what a captive dependency is.

Part of Pro Visual
91

How do you support cancellation in async C# code with CancellationToken and CancellationTokenSource?

Part of Pro Visual
92

What is IAsyncEnumerable<T> and how does await foreach differ from returning Task<IEnumerable<T>>?

Part of Pro Visual
93

How would you design a thread-safe singleton in C#?

Part of Pro
94

Should you ever call GC.Collect() manually?

Part of Pro
95

What is the correct middleware order for routing, CORS, authentication, and authorization in ASP.NET Core?

Part of Pro
96

Your endpoint returns 50 rows but the logs show 51 queries. What happened?

Part of Pro Visual
97

You see async void in a code review. Why do you flag it?

Part of Pro
98

Why should you override GetHashCode whenever you override Equals?

Part of Pro Visual
99

What is System.Threading.Channels, and when is it better than ConcurrentQueue?

Part of Pro Visual
100

Explain security best practices in C#.

Part of Pro
101

What actually happens when you call .Result or .Wait() on a Task?

Part of Pro Visual
Expert 11
102

Explain covariance and contravariance in generics.

Part of Pro Visual
103

Explain weak references and when to use them.

Part of Pro Visual
104

What is the stackalloc keyword and when should you use it?

Part of Pro
105

Explain Span<T> and Memory<T> and their use cases.

Part of Pro Visual
106

What are ref structs and their limitations?

Part of Pro Visual
107

Explain generic math and static interface members in C# 11.

Part of Pro
108

What are scoped variables and ref safety in C# 11?

Part of Pro Visual
109

Explain performance considerations and best practices in C#.

Part of Pro
110

What are source generators and how do they work?

Part of Pro Visual
111

What are expression trees and how are they used?

Part of Pro Visual
112

What is ValueTask<T> and when should you use it instead of Task<T>?

Part of Pro Visual

No matches

Try a different filter or search term.

Know someone prepping for C#? Send them this set.
Quick recap

C# in pictures.

A quick recap of C# in 31 short animated pictures, one idea at a time. About 8 min to get the whole topic back in your head before you walk in. Pause any picture, slow it down, or step through it.

Pro The first chapter is free to play. The other 26 pictures come with Pro.

Get Pro · $10/mo
Pro · $10/mo

98 of 112 C# answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime

Change topic

Pick a different technology or stack. Your current topic stays put until you choose a new one.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

Serverless on AWS

Serverless Architecture on AWS

Flutter Mobile

Flutter Cross-Platform Mobile Development

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

AI Engineer

LLMs, RAG, Agents, Evals

AI-Powered Developer

Claude Code, Copilot, Agentic Workflows

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git