Crack C# Interview
Basic C# Interview Questions
1. What is C#? What are its main features?
2. What is the difference between class and struct in C#?
3. What are value types and reference types in C#?
4. What is the difference between abstract and interface in C#?
5. Explain the concept of inheritance in C#. How is it implemented?
6. What is the purpose of the static keyword in C#?
7. What is a sealed class in C#, and why is it used?
8. What are properties in C#? How are they different from fields?
9. What is the difference between const and readonly in C#?
10. What are delegates in C#, and how are they used?
Intermediate C# Interview Questions
1. What is the difference between ref and out parameters in C#?
2. Explain boxing and unboxing in C#.
3. What are events in C#, and how are they related to delegates?
4. What is the difference between override, virtual, and new in C#?
5. What is the using statement in C#, and why is it used?
6. What is exception handling in C#? How is it implemented?
7. Explain the concept of garbage collection in C#.
8. What are extension methods in C#, and how do you define them?
9. What are generics in C#, and why are they used?
10. What is LINQ in C#? Provide examples of LINQ queries.
Advanced C# Interview Questions
1. What is the difference between Task and Thread in C#?
2. What are async/await in C#, and how do they work?
3. What are IEnumerable and IQueryable in C#, and how are they different?
4. Explain the concept of Dependency Injection in C#. How is it implemented?
5. What is a Tuple in C#, and when would you use it?
6. What is reflection in C#, and how can it be used?
7. What is the difference between shallow copy and deep copy in C#?
8. What are Action, Func, and Predicate delegates in C#?
9. What is the difference between IDisposable and the Finalize method?
10. What are attributes in C#, and how are they used?
C# Features and Concepts
1. What is a nullable type in C#?
2. What are anonymous types in C#?
3. What is a partial class in C#, and when would you use it?
4. What is the difference between String and StringBuilder in C#?
5. What is the purpose of yield in C#?
6. What are indexers in C#, and how are they implemented?
7. What is a Record type in C#?
8. What is the difference between Dispose() and a finalizer?
9. What is the purpose of the dynamic keyword in C#?
10. What are pattern matching enhancements in C#?
Scenario-Based C# Questions
1. How would you implement a singleton pattern in C#?
2. How do you handle multiple exceptions in C#?
3. How would you implement a custom collection in C#?
4. How would you improve the performance of a LINQ query?
5. How would you ensure thread safety in a multithreaded application in C#?
C# Coding Challenges
1. Write a program to reverse a string in C#.
2. Write a function to check if a number is a palindrome.
3. Implement a custom Stack class in C#.
4. Write a program to find the largest element in an array.
5. Create a program to demonstrate the use of delegates and events.
6. Implement a program to calculate Fibonacci numbers using recursion.
7. Write code to sort a list of objects by a specific property using LINQ.
8. Write a program to find duplicates in a list of integers.
9. Create a program that demonstrates Dependency Injection.
10. Write a program to implement a basic producer-consumer pattern.