CSharp
CSharp
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.