C# – Common interview questions

1 minute read

  1. What is value type and reference type?
  2. What is the use of dispose method?
  3. Give an example of method overloading and method overriding?
  4. What is class? Give a real life example.
  5. What is Object? Give a real life example.
  6. What is abstract class?
  7. Why partial class?
  8. What is predefined data type and user defined data type? Discuss with example.
  9. What is verbatim string? How it works?
  10. What is the difference between string and string builder?
  11. Why and how constant is used in C#?
  12. What is enumeration type? How it works?
  13. What do you know implicit and explicit conversion? Give an example.
  14. How switch statement works? What is the function of default in switch case?
  15. How break and continue keyword works? Give an example.
  16. What is the difference in for loop, while loop and do while loop?
  17. What is boxing and unboxing?
  18. What do you know about namespace and nested namespace? Why namespace is used?
  19. How parameter is passed by reference? Give an example.
  20. What is constructor? What is constructor overloading?
  21. Why constructor is used?
  22. Why read only variable is used?
  23. What is the difference between read only and constant variable?
  24. What is static class? Why static class is used?
  25. What is inheritance? Why is it necessary?
  26. What is sealed class? Why sealed class is used?
  27. What is abstract class?
  28. What is the difference between abstract class and interface?
  29. Is there any difference between “ ++I” and “i++”? How it works?