To avoid testing against the actual database, one might use a _________ database in integration testing.

  • Mock
  • In-memory
  • NoSQL
  • Distributed
To prevent integration tests from impacting the actual database, an in-memory database is often used. It simulates database behavior but operates entirely in memory, making tests faster and isolated. It's a common practice in ASP.NET Core testing.

One of the biggest advantages of ASP.NET Core over traditional ASP.NET is its ability to run on _________.

  • Multiple Platforms
  • Windows Only
  • Linux Only
  • macOS Only
One of the major advantages of ASP.NET Core is its ability to run on multiple platforms, including Windows, Linux, and macOS. This cross-platform compatibility provides greater flexibility in choosing the hosting environment for your ASP.NET Core applications.

When configuring ASP.NET Core Identity, the _________ class is used to specify policies like password strength and lockout duration.

  • 'PolicySettings'
  • 'AuthorizationOptions'
  • 'IdentityOptions'
  • 'SecurityPolicies'
When configuring ASP.NET Core Identity, the 'IdentityOptions' class is used to specify various settings, including policies like password strength and lockout duration. This class allows fine-grained control over the behavior of Identity.

In a situation where you're building a single-page application (SPA) with a default index.html, which middleware ensures that the file is served when a user accesses the root URL?

  • UseDefaultFiles
  • UseStaticFiles
  • UseRouting
  • UseEndpoints
The UseDefaultFiles middleware is used to serve default files, like index.html, when a user accesses the root URL of a web application. This middleware ensures that the SPA's default page is served correctly. Make sure to include app.UseDefaultFiles(); in your Configure method.

Your application uses ASP.NET Core Identity for authentication. During the security audit, it was pointed out that the application should enforce password reset every 90 days. How can you enforce this in ASP.NET Core?

  • Configure password expiration in IdentityOptions
  • Create a custom middleware to force password reset
  • Implement a password reset policy in the login controller
  • Use a third-party identity management library
To enforce password reset every 90 days in ASP.NET Core Identity, you should configure the password expiration policy in the IdentityOptions during application startup. This policy can be set to require users to change their passwords after a specified number of days.

In a CI/CD pipeline, what does the acronym CI stand for?

  • Continuous Integration
  • Continuous Inspection
  • Continuous Improvement
  • Container Isolation
CI stands for Continuous Integration. It's a development practice where code changes are automatically built, tested, and integrated into the shared codebase frequently. This helps detect and fix integration issues early in the development process.

You're working on an ASP.NET Core project where the client needs real-time updates from the server without constantly polling the server. Which technology in ASP.NET Core would you leverage?

  • SignalR
  • gRPC
  • WebSockets
  • REST API
In this scenario, you would leverage SignalR, which is a real-time communication library for ASP.NET Core. SignalR allows for bi-directional communication between the client and server, making it ideal for scenarios where you need real-time updates without the overhead of constant polling.

In ASP.NET Core Identity, the _________ method is used to authenticate a user with provided credentials.

  • SignInAsync
  • AuthenticateUser
  • AuthorizeUser
  • CheckCredentials
In ASP.NET Core Identity, the SignInAsync method is used to authenticate a user with provided credentials. This method handles the process of validating the user's username and password against the stored user data in the Identity system. It creates a security token for the authenticated user, allowing them access to protected resources.

To define an optional section in a Razor layout, you would use the _______ method.

  • @RenderPage
  • @RenderSection
  • @IncludeSection
  • @OptionalSection
To define an optional section in a Razor layout, you would use the @RenderSection method. This method allows you to specify content that can be overridden by views that use the layout. It's a powerful feature for creating flexible layouts in ASP.NET Core.

Imagine you're developing an ASP.NET Core application on a machine without any internet access. Which tool, among the following, allows you to install NuGet packages from a local feed or folder?

  • Visual Studio Code
  • NuGet Package Manager Console
  • .NET CLI
  • NuGet CLI
When working on a machine without internet access, you can use the NuGet CLI to install NuGet packages from a local feed or folder. The NuGet CLI provides command-line tools for interacting with NuGet packages, making it a suitable choice for such scenarios.