Posts

Showing posts from 2025

Questions

✅ .NET & MVC Interview Questions (Deloitte) ๐Ÿ”ท 1. What is Boxing and Unboxing? Boxing : Converting a value type (e.g., int , char ) to an object type. Example: int num = 10; object obj = num; // Boxing Unboxing : Extracting the value type from the object. Example: int result = (int)obj; // Unboxing ๐Ÿ”ท 2. Why is string immutable in C#? In C#, string is immutable , meaning once a string is created, it cannot be changed . Reasons: Thread safety : Multiple threads can use the same string instance safely. Performance optimization : String interning and memory sharing. Security : Prevents unexpected data manipulation. ๐Ÿ”ท 3. What is Garbage Collection and how did you implement it in your project? Garbage Collection (GC) : Automatic memory management that reclaims memory occupied by unreachable objects. How it works : Managed by the CLR (Common Language Runtime) . GC runs in generations (Gen 0, 1, 2) . Frees up memory, reduces memory leaks. ...