Saturday, 29 June 2024

C# Interview Questions

  1. Whats the difference between a .NET and C#?
  2. Differentiate between .NET framework vs .NET Core vs .NET 5.0
  3. What is an IL code?
  4. Why IL code is not fully compiled?
  5. Who compiles the IL code and how does it work?
  6. How does JIT compilationwork?
  7. What are different types of JIT?
  8. What is Native Image Generator (Ngen.exe)?
  9. So does it mean that NGEN.EXE will always improve performance?
  10. Is it possible to view the IL code ?
  11. What is a CLR?
  12. What is the difference between managed and unmanaged code?
  13. What is a garbage collector?
  14. What are generations in Garbage collector (Gen 0,  and )?
  15. Garbage collector cleans managed code, howdo we clean unmanaged code?
  16. But when we create a destructor the performance falls down?
  17. So how can we clean unmanaged objects and also maintain performance?
  18. Can we force garbage collector to run?
  19. What is the difference between finalize and dispose?
  20. What is CTS?
  21. What is a CLS (Common Language Specification)?
  22. What is an Assembly?
  23. What are the different types of Assembly?
  24. What is Namespace?
  25. What is Difference between NameSpace and Assembly?
  26. What is ILDASM?
  27. What is Manifest?
  28. Where is the version information stored of an assembly?
  29. Is versioning applicable to private assemblies?
  30. What is the use of strong names?
  31. What is Delay signing?
  32. What is GAC?
  33. How to add and remove an assembly from GAC?
  34. If we have two versions of the same assembly in GAC how to we make a choice?
  35. What is Reflection and why we need it? 5
  36. How do we implement reflection? 5
  37. What are the practical uses of reflection?
  38. What is the use of Dynamic keyword?
  39. What are practical uses of Dynamic keyword?
  40. What is the difference between Reflection and Dynamic?
  41. Figure .:- Reflection
  42. Explain the difference between early binding and late binding?
  43. What is the difference between VAR and Dynamic keyword? 0
  44. Explain term type safety and casting in C#?
  45. Explain casting, implicit conversion and explicit conversion?
  46. What are stack and heap?
  47. What are Value types and Reference types?
  48. What is concept of Boxing and Unboxing?
  49. How performance is affected due to boxing and unboxing?
  50. How can we avoid boxing and unboxing?
  51. If we have a class referencing value type, where is value type stored ?
  52. Are static variables stored on a heap or stack ?
  53. How to prevent my .NET DLL to be decompiled?
  54. What is the difference between Convert.toString and .toString () method?
  55. What is the difference between String vs string? 5
  56. So when both mean the same thing why are they different? 5
  57. So when to use “String” and “string”?
  58. How can we handle exceptions in .NET?
  59. How can I know from which source the exception occurred?
  60. What if we do not catch the exception?
  61. What are system level exceptions and application level exceptions?
  62. Can two catch blocks be executed?
  63. What are different types of collections in .NET?
  64. What is the difference between arraylist and list?
  65. Are Arraylist faster or Arrays?
  66. What are hashtable collections? 0
  67. What are Queues and stack collection? 0
  68. Can you explain generics in .NET? 0
  69. Explain generic constraints and when should we use them?
  70. Can you explain the concept of generic collection?
  71. What is the difference between dictionary and hashtable?
  72. What are the generic equivalent for array list,stack, queues and hashtable?
  73. What is the use of IEnumerable, ICollection, Ilist and IDictionary?
  74. Differentiate IEnumerable vs Iqueryable?
  75. What is code access security (CAS)? 5
  76. So how does CAS actually work?
  77. Is CAS supported in .NET .0?
  78. What is sandboxing?
  79. How can we create a windows service using .NET?
  80. What is serialization and deserialization in .NET?
  81. Can you mention some scenarios where we can use serialization? 0
  82. When should we use binary serialization as compared to XML serialization? 0
  83. What is Regular expression?
  84. What is time out support in regex (regular expression)?
  85. Can you explain the concept of “Short Circuiting”?
  86. What is the difference between “Typeof” and “GetType” ?
  87. Will the following c# code compile?
  88. Explain the use of Icomparable in c#?
  89. What is difference between Icomparable and IComparer ?
  90. Can you explain Lazy Loading?
  91. So how do we implement “LazyLoading” ?
  92. Are there any readymade objects in .NET by which we can implement Lazy loading? 5
  93. What are the advantages / disadvantages of lazy loading?
  94. What is the difference between “IS” and “AS” keyword ?
  95. What is the use of “Yield” keyword?
  96. What is the difference between “==” and .Equals()?
  97. What’s the difference between catch with parameter and catch without parameter?
  98. What are attributes and why do we need it?
  99. How can we create custom Attributes?
  100. How can we mark a method as deprecated?
  101. What is the difference between Build Vs Rebuild Vs Clean solution menu ?
  102. What is the difference between i++ vs ++i ?
  103. When should we use “??”(NULL Coalescing operator)?
  104. Explain need of NULLABLE types ?
  105. In what scenario’s we will use NULLABLE types ?
  106. What is the benefit of coalescing?


No comments:

Post a Comment

Thanks for the contribution, our team will check and reply back if response required.