■ C# | SQL | ASP.
NET MVC – Test Paper
Part 1: Core C# (Normal C# – 5 Questions)
1. What is the difference between value types and reference types in C#? (Give examples for
each.)
2. What is encapsulation in C#? Write a short code example using properties.
3. What is the difference between abstract class and interface in C#?
4. Explain the concept of inheritance with an example.
5. What is the difference between const, readonly, and static keywords?
Part 2: Collections (5 Questions)
1. What is the difference between ArrayList, List, and HashSet?
2. When should you use a Dictionary instead of a List?
3. Explain the difference between Stack and Queue in C#. Give an example.
4. What is the purpose of the IEnumerable and IEnumerator interfaces?
5. What happens if you modify a collection (e.g., add/remove elements) while iterating using
foreach?
■ Section B — SQL (5 Marks)
1. Write a SQL query to get the second highest salary from an Employee table.
2. What is the difference between INNER JOIN, LEFT JOIN, and RIGHT JOIN?
3. Write a query to count the number of employees in each department.
4. What is a Primary Key and Foreign Key? Explain with an example.
5. What is the difference between DELETE, TRUNCATE, and DROP commands?
■ Section C — [Link] MVC (5 Marks)
1. Explain the MVC architecture and the role of each component (Model, View, Controller).
2. What is the difference between ViewData, ViewBag, and TempData in MVC?
3. Explain the Routing mechanism in MVC and how routes are configured in [Link].
4. What are Action Filters in MVC? List a few types.
5. How can you perform model validation in [Link] MVC? (Give an example.)