.net basics Quiz

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

  1. Understanding the .NET Framework

    What is the primary purpose of the .NET Framework in backend development?

    1. To create operating systems
    2. To replace databases
    3. To serve as a front-end design tool
    4. To provide a managed runtime environment for applications

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

  2. Common Language Runtime (CLR)

    Which component of .NET executes managed code and provides essential services such as garbage collection?

    1. Windows Forms
    2. Common Language Runtime
    3. Entity Framework
    4. ASP.NET MVC

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

  3. C# as a .NET Language

    Why is C# commonly used for backend development in .NET?

    1. It cannot interact with databases
    2. It is not compatible with .NET libraries
    3. It integrates natively with .NET frameworks and supports modern programming paradigms
    4. C# is only used for front-end web development

    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.

  4. ASP.NET Core Framework

    What is one major advantage of using ASP.NET Core for building backend services?

    1. Cross-platform support
    2. Provides only desktop GUI features
    3. Limited to Windows only
    4. Requires no internet connectivity

    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.

  5. Understanding Middleware

    In .NET backend development, what is the role of middleware in a web application pipeline?

    1. To manage physical network hardware
    2. To store application data permanently
    3. To process HTTP requests and responses in a pipeline sequence
    4. To design the user interface

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

  6. Entity Framework Purpose

    What is the main purpose of Entity Framework in .NET backend projects?

    1. To create graphics for games
    2. To manage security authentication only
    3. To configure network routers
    4. To facilitate object-relational mapping between database tables and .NET objects

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

  7. HTTP Controllers in Web APIs

    What is the responsibility of a controller in a .NET Web API project?

    1. Managing cloud infrastructure
    2. Handling HTTP requests and returning appropriate responses
    3. Rendering HTML views directly
    4. Direct database management

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

  8. Dependency Injection

    How does .NET use dependency injection in backend development?

    1. To inject defects for testing
    2. To create client-side animations
    3. To administer operating systems
    4. To provide required service instances to classes at runtime

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

  9. Configuration Management

    Which file is commonly used in .NET backend applications for managing environment-specific settings?

    1. Icon.ico
    2. appsettings.json
    3. index.html
    4. main.exe

    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.

  10. LINQ in Data Queries

    What is the main advantage of using LINQ in .NET backend development?

    1. It can only be used with XML files
    2. It replaces all SQL queries in every situation
    3. It is used only for image processing tasks
    4. It allows developers to write type-safe data queries within the code

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