All 58 questions
What is the difference between value types and reference types in C#?
Asked in 4 of 95 interviews · last asked Sep 21 · Concept · Junior
Show answer
A value-type variable holds the value itself; a reference-type variable holds a reference to an object. Assignment copies the value for value types and the reference for reference types. Two reference-type variables can point to the same object, so changes to that object's data can be seen through both.
- Structs and enums are value types; classes, arrays, and strings are reference types.
- Value types are not always on the stack; storage depends on where they are used.
- Copying a struct copies its fields, but reference-type fields still point to the same objects.
- Reference types can hold null; value types need Nullable<T> to represent null.
What the interviewer checks: The interviewer is checking whether you understand copying, shared objects, and why stack versus heap is not the main distinction.
Other ways it was asked
- “Do you know the difference between reference types and value types?”
- “Tell me a bit about the differences between value types and reference types.”
- “What is the difference between reference types and value types?”
What does the `virtual` keyword do in C#, and when would you use it?
Asked in 3 of 95 interviews · last asked Aug 19 · Concept · Junior
Show answer
In C#, `virtual` lets a derived class replace an inherited member's implementation using `override`. When you call a virtual method, the object's runtime type determines which implementation runs. Use it when a base class provides default behavior that derived classes may need to change.
- Methods, properties, indexers, and events can be virtual.
- Overriding is optional; the inherited implementation runs if no override replaces it.
- Class methods are non-virtual by default. Use `override`, not `new`, to change virtual behavior.
What the interviewer checks: The interviewer is checking whether you understand overriding and how virtual calls support polymorphism.
Other ways it was asked
- “What is the virtual keyword used for in C#?”
- “What is the virtual keyword, and why do we use it?”
What is the difference between ref and out keywords in C#?
Asked in 2 of 95 interviews · last asked Oct 1 · Concept · Junior
Other ways it was asked
- “What is the difference between ref, out, and in parameters in C#?”
What are generics in C#, and when would you use them?
Asked in 2 of 95 interviews · last asked Sep 4 · Concept · Junior
Other ways it was asked
- “Why were generics created in C#?”
What is the difference between a class and a struct in C#?
Asked in 2 of 95 interviews · last asked Sep 10 · Concept · Mid-level
Other ways it was asked
- “What is the difference between a struct and a class in C#?”
What is the difference between method overloading and method overriding in C#?
Asked once · last asked Apr 20 · Concept · Junior
Can you explain what custom attributes are in the context of reflection and how you would retrieve them from a class or member at runtime?
Asked once · last asked Jun 13 · Concept · Mid-level
Other ways it was asked
- “How would you retrieve custom attributes at runtime using reflection? What method or approach would you use?”
In C#, how do default equality and ordering comparisons work, and when would you customize CompareTo or GetHashCode?
Asked once · last asked Jan 28 · Concept · Mid-level
Other ways it was asked
- “In C#, how does default comparison work, and when should you override CompareTo or GetHashCode?”
When would you override GetHashCode in C#?
Asked once · last asked Jan 28 · Scenario · Mid-level
In C#, if two separate instances of a class have identical property values, will GetHashCode return the same or different values by default?
Asked once · last asked Jan 28 · Concept · Mid-level
If two separate instances of a C# class have identical property values and are used as dictionary keys, will the dictionary store one entry or two?
Asked once · last asked Jan 28 · Concept · Mid-level
Other ways it was asked
- “If two separate instances of a C# class have identical property values, will a dictionary store one entry or two?”
If two separate instances of a C# class have identical property values, will a HashSet store one item or two?
Asked once · last asked Jan 28 · Concept · Mid-level
How can you use one method for multiple value types in C# while avoiding boxing, rather than writing a separate method for each type?
Asked once · last asked Jan 28 · Concept · Senior
When would you choose a record, class, or struct for a domain type, and why?
Asked once · last asked Mar 16 · Concept · Mid-level
If IUser inherits from IAccount in C#, where should methods declared in IAccount be implemented: in IUser or in a concrete class?
Asked once · last asked Mar 25 · Concept · Junior
In C#, how does a class implement a method declared in an interface when the interface provides no implementation?
Asked once · last asked Mar 25 · Concept · Junior
Which performs better in C#: a generic collection such as List<T> or a non-generic collection such as ArrayList?
Asked once · last asked Mar 25 · Concept · Mid-level
Why should you avoid using ArrayList extensively in a C# project?
Asked once · last asked Mar 25 · Concept · Junior
Why are strings compared by value in C# even though string is a reference type?
Asked once · last asked Apr 2 · Concept · Mid-level
Does C# support multiple inheritance of classes, allowing a class to inherit from two base classes?
Asked once · last asked Apr 20 · Concept · Junior
What is reflection in C#, and why would a developer use it?
Asked once · last asked Jun 13 · Concept · Junior
What is the Type class in C#, and what information can you retrieve using it?
Asked once · last asked Jun 13 · Concept · Junior
Other ways it was asked
- “Can you explain what the Type class is and what information you can retrieve using it?”
What is the difference between Assembly.GetExecutingAssembly and Assembly.Load?
Asked once · last asked Jun 13 · Concept · Mid-level
How do you inspect generic types and methods and retrieve their type arguments using reflection?
Asked once · last asked Jun 13 · Concept · Mid-level
Other ways it was asked
- “How can you use reflection to inspect generic types and methods? For example, if you have a generic class, how would you inspect its generic type arguments?”
- “Once you've confirmed that a type or method is generic, how would you retrieve its specific generic type arguments? What method would you call?”
What are some security concerns or risks when using reflection in C#, especially when accessing private members or using it in restricted environments?
Asked once · last asked Jun 13 · Scenario · Senior
In C#, how do you choose between an abstract class and an interface for a domain service contract, especially around versioning and default behavior?
Asked once · last asked Aug 4 · Concept · Senior
When would you choose an abstract class versus an interface in C#, and what’s the key difference between them?
Asked once · last asked Aug 6 · Concept · Mid-level
What is a delegate in C#, how does it differ from a regular method call, and how do events build on top of delegates?
Asked once · last asked Aug 6 · Concept · Mid-level
What’s the difference between List<T> and Dictionary<T, TValue>, and when would you choose one over the other?
Asked once · last asked Aug 6 · Concept · Junior
What generic type constraints are available in C#?
Asked once · last asked Sep 4 · Concept · Mid-level
Other ways it was asked
- “Which constraints do you know for generics?”
In C#, what happens to memory and parameter passing when a method is called with two int variables?
Asked once · last asked Sep 10 · Concept · Mid-level
In C#, what is passed to a method when you pass two User objects?
Asked once · last asked Sep 10 · Concept · Mid-level
In C#, what happens to the caller's object reference if a method reassigns its parameter to a new object?
Asked once · last asked Sep 10 · Concept · Mid-level
When passing a large amount of data to a method, when would you choose a class versus a struct?
Asked once · last asked Sep 10 · Concept · Senior
Is System.Object a reference type or value type?
Asked once · last asked Sep 21 · Concept · Junior
How can an integer be a value type if it derives from System.Object?
Asked once · last asked Sep 21 · Concept · Mid-level
Write down a short code example showing an interface and its implementation in C#.
Asked once · last asked Oct 1 · Write code · Junior
In C#, what is abstraction, and how do you implement it?
Asked once · last asked Jan 26 · Concept · Mid-level
Which C# keywords can you use to implement abstraction in a class?
Asked once · last asked Jan 26 · Concept · Mid-level
What is a sealed class, and how would you use the sealed concept in your application?
Asked once · last asked Jan 26 · Concept · Mid-level
Other ways it was asked
- “Can you give a real-world use case for applying the sealed concept?”
What is the purpose of the GetHashCode method in C#?
Asked once · last asked Jan 28 · Concept · Junior
Other ways it was asked
- “How does GetHashCode work under the hood in C#?”
Can an interface have virtual methods in C#?
Asked once · last asked Mar 25 · Concept · Junior
Other ways it was asked
- “Can an interface have abstract methods in C#?”
What is a base class in C#?
Asked once · last asked Sep 21 · Concept · Junior
Other ways it was asked
- “What is the base class of all classes in C#?”
How does comparison work for reference types in C#?
Asked once · last asked Jan 28 · Concept · Junior
What is a constructor in C#, and what types of constructors does it support?
Asked once · last asked Mar 25 · Concept · Junior
What is the purpose of a private constructor in C#?
Asked once · last asked Mar 25 · Concept · Junior
Other ways it was asked
- “Which design pattern commonly uses a private constructor in C#?”
Can a static constructor have parameters in C#?
Asked once · last asked Mar 25 · Concept · Junior
What is an interface in C#?
Asked once · last asked Mar 25 · Concept · Junior
Can an interface inherit from another interface in C#?
Asked once · last asked Mar 25 · Concept · Junior
What are generic collections in C#?
Asked once · last asked Mar 25 · Concept · Junior
Is List<T> a generic or non-generic collection in C#?
Asked once · last asked Mar 25 · Concept · Junior
Other ways it was asked
- “Is Dictionary<TKey, TValue> a generic or non-generic collection in C#?”
Is string a reference type in C#?
Asked once · last asked Apr 2 · Concept · Junior
Other ways it was asked
- “Is string a reference type?”
Are .NET references the same as pointers?
Asked once · last asked May 7 · Concept · Junior
Which namespace in C# is used to implement reflection?
Asked once · last asked Jun 13 · Concept · Junior
What are the different types of exceptions in .NET?
Asked once · last asked Sep 18 · Concept · Junior
How can a C# method return multiple values?
Asked once · last asked Sep 21 · Concept · Junior
Can you give a practical example of when using an interface in C# is a good design choice?
Asked once · last asked Sep 25 · Concept · Junior
What are the core concepts of C#, and how does the language work?
Asked once · last asked Oct 14 · Concept · Junior
More C# and .NET interview questions
- All C# and .NET interview questions
- C# Async, Await and Multithreading Interview Questions
- ASP.NET Core MVC and Web API Interview Questions
How this list is made
Every question here was asked by a real interviewer in a real job interview that a candidate ran MeetAssist in. After the call, the interviewer's questions are pulled from the transcript. Practice sessions, tests, exams and anything that was not a job interview are dropped.
Questions are rewritten so they make sense on their own: names of people, employers and clients are removed, and speech-to-text mistakes are fixed. Small talk, logistics and questions about one candidate's own résumé are left out. Rephrasings of the same question are merged, and the count is the number of different interviews it came up in.
The interviews come from candidates who use MeetAssist, so they lean towards software, data and AI roles: the shares describe these interviews, not every C# and .NET interview. Answers to the most asked questions are written and checked by an editor; a "common mistake" is shown only when reviews of real answers in these interviews show it, with the count.
95 interviews, 54 candidates, Jan 2026 to Oct 2026. Updated every month with new interviews.
Or add the Chrome extension