C# – Common interview questions
1 minute read
- What is value type and reference type?
- What is the use of dispose method?
- Give an example of method overloading and method overriding?
- What is class? Give a real life example.
- What is Object? Give a real life example.
- What is abstract class?
- Why partial class?
- What is predefined data type and user defined data type? Discuss with example.
- What is verbatim string? How it works?
- What is the difference between string and string builder?
- Why and how constant is used in C#?
- What is enumeration type? How it works?
- What do you know implicit and explicit conversion? Give an example.
- How switch statement works? What is the function of default in switch case?
- How break and continue keyword works? Give an example.
- What is the difference in for loop, while loop and do while loop?
- What is boxing and unboxing?
- What do you know about namespace and nested namespace? Why namespace is used?
- How parameter is passed by reference? Give an example.
- What is constructor? What is constructor overloading?
- Why constructor is used?
- Why read only variable is used?
- What is the difference between read only and constant variable?
- What is static class? Why static class is used?
- What is inheritance? Why is it necessary?
- What is sealed class? Why sealed class is used?
- What is abstract class?
- What is the difference between abstract class and interface?
- Is there any difference between “ ++I” and “i++”? How it works?