You are creating a website and want to add a folder for storing images, scripts, and CSS files. Which default folder in ASP.NET Core would you typically use?

  • wwwroot
  • App_Data
  • Views
  • Controllers
In ASP.NET Core, the 'wwwroot' folder is the default location for storing static web assets like images, scripts, and CSS files. These assets can be directly served to clients without the need for additional routing.

What distinguishes the Kestrel web server in the ASP.NET Core ecosystem?

  • It's a Windows-exclusive web server
  • It's a cross-platform, lightweight, and high-performance web server
  • It's a reverse proxy server
  • It's used for database management
Kestrel is a distinctive component in the ASP.NET Core ecosystem because it's a cross-platform, lightweight, and high-performance web server. Unlike some other web servers that are platform-specific, Kestrel can run on Windows, Linux, and macOS, making it a preferred choice for ASP.NET Core hosting. It is often used in combination with reverse proxy servers like Nginx or IIS for production scenarios.

Which file in an ASP.NET Core project typically contains project metadata, package dependencies, and project-specific settings?

  • Program.cs
  • Startup.cs
  • appsettings.json
  • project.json
The appsettings.json file in an ASP.NET Core project typically contains project metadata, package dependencies, and project-specific settings. It's a JSON configuration file used to store various configuration values for the application, such as database connection strings, logging settings, and custom application settings. This separation of configuration from code promotes flexibility and maintainability in ASP.NET Core applications.

If you want to specify multiple roles for an action or a controller using the [Authorize] attribute, how would you do it?

  • [Authorize(Roles = "Admin, Manager")]
  • [Authorize(Role = "Admin", Role = "Manager")]
  • [Authorize("Admin, Manager")]
  • [Authorize("Admin", "Manager")]
To specify multiple roles using the [Authorize] attribute, you can separate them with commas inside the Roles parameter, like this: [Authorize(Roles = "Admin, Manager")]. This allows access to the action or controller for users who belong to either the "Admin" role or the "Manager" role or both.

In ASP.NET Core, custom middlewares can be created using a delegate with the signature _______.

  • Func
  • Action
  • Func
  • MiddlewareDelegate
Custom middlewares in ASP.NET Core are created using a delegate with the signature Func. This delegate takes an HttpContext as input and returns a Task, allowing you to write custom logic to handle requests and responses in the pipeline.

The _________ file was a unique feature in the early versions of ASP.NET Core but was later replaced in .NET Core 2.0 and beyond.

  • appsettings.json
  • package.json
  • project.json
  • web.config
The project.json file was used in the early versions of ASP.NET Core (then known as ASP.NET 5), but it was replaced with the .csproj file format in .NET Core 2.0 and beyond. The project.json file defined project dependencies and configuration settings.

You've just started with ASP.NET Core and want to set up a new MVC project. Which tool or environment would you typically use to create this project?

  • Visual Studio Code
  • Photoshop
  • Notepad
  • Microsoft Word
To create a new ASP.NET Core MVC project, you would typically use an integrated development environment (IDE) like 'Visual Studio Code.' Visual Studio Code provides excellent support for ASP.NET Core development, including project templates and extensions that streamline the development process.

What is the primary purpose of Razor Layout Views in ASP.NET Core?

  • Define the structure for multiple views
  • Handle HTTP requests
  • Create database tables
  • Design user interfaces
Razor Layout Views in ASP.NET Core are primarily used to define the common structure or layout that multiple Razor views within your application will share. This allows you to maintain a consistent look and feel across various parts of your web application. They help separate the presentation logic from the content-specific views.

Which design principle suggests that each component of MVC (Model, View, Controller) should have a distinct and separate responsibility?

  • Separation of Concerns (SoC)
  • Don't Repeat Yourself (DRY)
  • Model-View-ViewModel (MVVM)
  • Object-Relational Mapping (ORM)
The Separation of Concerns (SoC) is a fundamental design principle in ASP.NET Core MVC. It advocates for dividing the application into distinct and separate components, where the Model handles data, the View manages the presentation, and the Controller orchestrates the flow of data between them. This separation enhances maintainability, testability, and scalability.

One core feature of ASP.NET Core Identity is the ability to provide _________-factor authentication.

  • Two
  • Three
  • Four
  • Five
One of the core features of ASP.NET Core Identity is its ability to provide two-factor authentication (2FA). This adds an extra layer of security by requiring users to provide two forms of identification, typically something they know (password) and something they have (e.g., a mobile app-generated code) when logging in.

You want to develop a web application that can run seamlessly on both Linux and Windows without modifying the codebase. Why might ASP.NET Core be suitable for this task?

  • Cross-Platform Compatibility
  • Windows-Only Features
  • Legacy Code Integration
  • Proprietary Licensing
ASP.NET Core's primary advantage in this scenario is its cross-platform compatibility. It allows you to develop a web application that seamlessly runs on both Linux and Windows without the need for codebase modifications. This flexibility is especially valuable when targeting multiple platforms and ensuring a consistent user experience across them.

In SignalR, what term is used to describe a group of connections that can be broadcast to?

  • Hub
  • Cluster
  • Node
  • Router
In SignalR, a "Hub" is used to describe a group of connections that can be broadcast to. Hubs provide a high-level API for organizing connections and managing communication between clients and the server in real-time applications.