.NET is a popular open-source framework for backend development that enables building reliable and scalable applications. This quiz assesses foundational knowledge of core .NET concepts and features.
What is the primary purpose of the .NET Framework in backend development?
Explanation: The .NET Framework offers a managed runtime that simplifies application development and provides services like memory management and security. It is not a front-end tool (B), cannot replace databases (C), and is not for developing operating systems (D).
Which component of .NET executes managed code and provides essential services such as garbage collection?
Explanation: The Common Language Runtime (CLR) is responsible for executing managed code and offering services like garbage collection. Entity Framework is an ORM (B), Windows Forms is for GUI applications (C), and ASP.NET MVC is a web framework (D).
Why is C# commonly used for backend development in .NET?
Explanation: C# is popular in .NET backend development due to its native integration, strong typing, and support for OOP and asynchronous programming. Options B and C are incorrect; C# is used in backend and can work with databases. Option D is also false, as C# is fully compatible with .NET libraries.
What is one major advantage of using ASP.NET Core for building backend services?
Explanation: ASP.NET Core enables development on multiple platforms, including Windows, Linux, and macOS, supporting diverse deployment scenarios. Option B is outdated, option C confuses with desktop frameworks, and option D is incorrect as most backend services require network access.
In .NET backend development, what is the role of middleware in a web application pipeline?
Explanation: Middleware in .NET web applications handles HTTP requests and responses, enabling tasks like authentication and logging. It does not store data persistently (B), design UIs (C), or manage hardware (D).
What is the main purpose of Entity Framework in .NET backend projects?
Explanation: Entity Framework simplifies database interactions by mapping database tables to .NET objects. It does not focus solely on security (B), is not a graphics engine (C), and has nothing to do with network hardware (D).
What is the responsibility of a controller in a .NET Web API project?
Explanation: Controllers in .NET Web APIs are designed to process incoming HTTP requests and produce responses, typically JSON or XML. They do not directly manage databases (B), focus on rendering HTML (C), or manage infrastructure (D).
How does .NET use dependency injection in backend development?
Explanation: Dependency injection allows .NET applications to receive service instances via constructors or properties, improving modularity and testing. It does not add defects (B), create animations (C), or administer OS tasks (D).
Which file is commonly used in .NET backend applications for managing environment-specific settings?
Explanation: The appsettings.json file is standard in .NET for managing configurations like connection strings and settings per environment. main.exe is an executable, index.html is for web front-ends, and Icon.ico is an image file.
What is the main advantage of using LINQ in .NET backend development?
Explanation: LINQ makes querying collections and data sources type-safe and integrated with .NET languages. It does not completely replace SQL (B), is not for images (C), and supports many sources beyond XML (D).