Monday, June 3, 2024

ASP.Net core Interview Questions

 

How to secure web Api Application in core:

·        Add Authentication and Authorization



·        Secure communication with TLS and Https



·        Validate and Sanitize user inputs



·        Input rate limiting: Limit the number of requests a user or IP address can make within a certain time frame to Prevent DOS attacks

·        Logging and Monitoring

·        Keep software up to date.

What makes .net core platform independent?

Several key factors contribute to .NET Core's platform independence:

1. Intermediate Language (IL):

  • .NET Core code is compiled into an intermediate language (IL) called Common Intermediate Language (CIL). This IL is not specific to any operating system.
  • When you run a .NET Core application, a Just-In-Time (JIT) compiler on the target system translates the IL into machine code optimized for that particular platform (Windows, Linux, macOS).

2. .NET Core Runtime (dotnet):

  • The .NET Core runtime (dotnet) is a set of libraries and tools that provide the environment for executing .NET Core applications.
  • This runtime is available for different operating systems, allowing .NET Core applications to run consistently across them.
  • The runtime includes components for garbage collection, memory management, and other essential services needed for .NET Core applications to function.

3. Core Libraries:

  • .NET Core offers a subset of the full .NET Framework class library, containing core functionalities like file I/O, networking, and data structures.
  • These core libraries are designed to be platform-independent, ensuring consistent behavior across different operating systems.

4. Self-Contained Deployments:

  • .NET Core applications can be self-contained, meaning they include all the necessary dependencies (runtime, libraries) within the application package.
  • This eliminates the need to have a specific version of the .NET runtime pre-installed on the target machine.

5. Alternative Implementations:

  • For functionalities not directly available in the core libraries, .NET Core can leverage platform-specific implementations.
  • For example, on Windows, it might use the native Win32 API for some tasks, while on Linux, it might use POSIX libraries. These platform-specific parts are typically abstracted away from the developer's code.

In summary:

  • The combination of IL, .NET Core runtime availability, core libraries, self-contained deployments, and alternative implementations allows .NET Core applications to be written once and run on various operating systems without significant modifications.

State Management In Asp.net Core?

·        Client Side Validations:

1.      Cookies

2.      Local Storage

3.      Session Storage

4.      Database Storage



3


3. Database Storage:

           

 Difference Between App run and App use?



· app.Run is like the final station where the product is inspected and packaged for shipment. No further processing happens after this point. 

· app.Use is like adding additional stations to the assembly line. Each station performs a specific task on the product before passing it on to the next station. 




How to do Caching in .Net core?

·        In Memory Caching: Microsoft extensions. 

·        




 

 

 


No comments:

Post a Comment

ASP.Net core Interview Questions

  How to secure web Api Application in core: ·         Add Authentication and Authorization ·         Secure communication with TLS ...