Home / Interview Preparation / .NETCORE Technical Interview Questions and Answers

.NETCORE Technical Interview Questions and Answers

Last updated on April 16th, 2023

Estimated reading time: 11 minutes

Planning for your Dream Job ? The most important step is technical interview preparation. With so much to prepare in short time and with enormous resources available online it is difficult to find all required content in one place. We have consolidated all important content to help you prepare on .NETCORE topic.

.NETCORE Technical Interview Questions

Q1: What is ASP.NET Core?

Answer:ASP.NET Core is the open-source version of ASP.NET, that runs on macOS, Linux, and Windows. ASP.NET Core was first released in 2016 and is a re-design of earlier Windows-only versions of ASP.NET.ASP.NET Core is designed to allow runtime components, APIs, compilers, and languages evolve quickly, while still providing a stable and supported platform to keep apps running. Multiple versions of ASP.NET Core can exist side by side on the same server. Meaning one app can adopt the latest version, while other apps keep running on the version they were tested on. The ASP.NET Core runtime that your app runs on can be deployed as part of your app or installed centrally on your web server. ASP.NET Core is also perfectly suited for Docker containers.

Q2: What is .NET Standard?

There are various implementations of .NET. Each implementation allows .NET code to execute in different places—Linux, macOS, Windows, iOS, Android, and many more. .NET Standard is a formal specification of the APIs that are common across all these .NET implementations.

Q3: What are some characteristics of .NET Core

Flexible deployment: Can be included in your app or installed side-by-side user- or machine-wide.
Cross-platform: Runs on Windows, macOS and Linux; can be ported to other OSes. The supported
Operating Systems (OS), CPUs and application scenarios will grow over time, provided by Microsoft, other
companies, and individuals.
Command-line tools: All product scenarios can be exercised at the command-line.
Compatible: .NET Core is compatible with .NET Framework, Xamarin and Mono, via the .NET Standard
Library.
Open source: The .NET Core platform is open source, using MIT and Apache 2 licenses. Documentation is
licensed under CC-BY. .NET Core is a .NET Foundation project.
Supported by Microsoft: .NET Core is supported by Microsoft, per .NET Core Support

Q4: What is Kestrel ?

Kestrel is a cross-platform web server built for ASP.NET Core.
It is a default web server. Generally it is used as reverse proxy server along with IIS, Nginx or Apache.

Q4: What is .NET Standard and why we need to consider it ?

.NET Standard is a set of APIs (Application Programming Interfaces) that define a standard set of functionality that must be present in all .NET implementations. It provides a common interface for .NET libraries to work across different platforms, such as .NET Framework, .NET Core, and Xamarin. .NET Standard helps to solve the problem of fragmentation within the .NET ecosystem by providing a common ground for developers to target their libraries. This makes it easier to create libraries that can be used across different platforms and reduces the amount of code duplication needed to support different platforms. If you are developing a library or framework that will be used by other developers, you should consider targeting .NET Standard instead of a specific implementation of .NET. This will make your library compatible with a wider range of platforms and increase its potential audience. Additionally, if you are developing an application that targets multiple platforms, you can use .NET Standard libraries to share code between platforms, which can save time and effort in development.

Q5: What is difference between .NET Core and .NET Framework?

.NET Core and .NET Framework are both implementations of the .NET platform, but they have some differences in their architecture, features, and compatibility.

  1. Architecture: .NET Core is a modular and lightweight platform designed for building modern, cloud-based applications, while .NET Framework is a monolithic platform designed for building Windows desktop and server applications.
  2. Cross-Platform Support: .NET Core is designed to work on multiple platforms including Windows, Linux, and macOS, while .NET Framework only works on Windows.
  3. Deployment Model: .NET Core applications are deployed as self-contained executables, which include the .NET Core runtime and any required libraries, while .NET Framework applications require the framework to be installed on the target machine.
  4. Compatibility: .NET Core is not backward-compatible with .NET Framework, meaning that applications developed for .NET Framework will not run on .NET Core without modification.
  5. Libraries: While .NET Core has a smaller set of APIs compared to .NET Framework, it includes many modern libraries, including support for asynchronous programming, web applications, and containers.
  6. Development Experience: .NET Core includes support for modern development practices such as command-line tools, lightweight editors, and microservices architecture, while .NET Framework has a more traditional development experience with support for Windows Forms, WPF, and other desktop application technologies.

Q6: What is MSIL?

MSIL stands for Microsoft Intermediate Language, also known as CIL (Common Intermediate Language) or simply IL (Intermediate Language). It is a low-level, platform-agnostic, bytecode-like language that is used as an intermediate step in the compilation process for .NET applications. When a .NET application is compiled, the source code is first converted into MSIL code. This MSIL code is then packaged into a .NET assembly, which includes metadata about the types and members in the code. At runtime, the assembly is loaded into the .NET runtime environment, which just-in-time (JIT) compiles the MSIL code into native code that can be executed by the computer’s processor. One of the benefits of using MSIL is that it allows .NET applications to be compiled once and run on any platform that has a compatible .NET runtime environment. This is possible because the MSIL code is designed to be platform-agnostic, meaning that it can be interpreted by any platform-specific runtime environment.

Q7: What is a .NET application domain?

In the .NET framework, an application domain is a lightweight and isolated environment that allows applications to run within a common process. An application domain provides a virtual boundary for the execution of .NET code, allowing multiple applications to be run within the same process space, while keeping them isolated from each other. Each application domain has its own set of loaded assemblies, configuration settings, security policies, and memory space. This enables multiple applications to run within the same process, while ensuring that they do not interfere with each other or share resources in an unintended way. Application domains are created and managed by the .NET runtime, and can be unloaded when they are no longer needed. This allows for better memory management and resource allocation, as well as enhanced security and isolation of different applications.

Q 8: What is CTS?

CTS stands for Common Type System, which is a fundamental concept in the .NET Framework. CTS defines a standard set of rules and guidelines that all .NET languages must follow in order to ensure interoperability between different .NET languages and libraries. The Common Type System defines a set of common data types that can be used by all .NET languages, regardless of the language in which they were written. These common data types include basic data types such as integers, floating point numbers, and strings, as well as more complex data types such as classes, structures, and interfaces.In addition to defining common data types, CTS also defines rules for how these data types can be used and manipulated by different .NET languages. This includes rules for type casting, inheritance, and method overloading. By following the rules and guidelines set forth by the Common Type System, .NET languages can communicate and share data with each other seamlessly

Q 9 : What you understand by Value types and Reference types in .NET

In .NET, variables can be classified into two types: value types and reference types.Value types are types that store their data directly in memory, and they are typically smaller in size than reference types. Examples of value types include integers, floating-point numbers, boolean values, and structures. When you assign a value type to a variable or pass it as a parameter to a method, a copy of the data is created and assigned to the new variable or parameter.Reference types, on the other hand, store a reference to an object in memory, rather than the data itself. Examples of reference types include classes, interfaces, and delegates. When you assign a reference type to a variable or pass it as a parameter to a method, a reference to the original object is created, rather than a copy of the data. Multiple variables or parameters can hold references to the same object in memory.

Q 10:What is Boxing and Unboxing?

Boxing is the process of converting a value type to a reference type by wrapping the value type in an object. When a value type is boxed, a new object is created on the heap, and the value of the value type is copied into the object. This allows the value type to be treated as a reference type, and it can be passed as a parameter to methods that expect reference types.Unboxing is the process of extracting the value type from the boxed object and converting it back to a value type. When an object is unboxed, the value of the value type is copied from the object to a new value type variable. This allows the value type to be treated as a value type again, and it can be used with operators and methods that work with value types.

Q 11:Explain two types of deployment for .NET Core applications?

Framework-dependent deployment (FDD) – The app contains only its own code and any third-party dependencies that
are outside of the .NET Core libraries. FDDs contain .dll files that can be launched by using the dotnet utility
from the command line. It relies on presence of .NET framework sdk present on targeted system.
Self-contained deployment – Unlike FDD, a self-contained deployment (SCD) doesn’t rely on the presence
of shared components on the target system. All components, including both the .NET Core libraries and the
.NET Core runtime, are included with the application and are isolated from other .NET Core applications.
SCDs include an executable (such as app.exe on Windows platforms for an application named app), which is
a renamed version of the platform-specific .NET Core host, and a .dll file (such as app.dll), which is the actual application.

Q12: What is CoreCLR?

CoreCLR is the execution engine for .NET Core, an open-source, cross-platform, and modular implementation of the .NET framework. It is responsible for compiling and executing managed code written in C#, F#, or Visual Basic.CoreCLR provides a number of features, including Just-In-Time (JIT) compilation, garbage collection, and exception handling. JIT compilation means that the code is compiled on-the-fly, rather than ahead of time, which allows for better performance and flexibility. Garbage collection is a process that automatically frees up memory that is no longer in use by the program. Exception handling allows for the graceful handling of errors that occur during program execution.

Q13: Why to use of the IDisposable interface

The IDisposable interface is used in C# and .NET programming to provide a mechanism for releasing unmanaged resources used by an object, such as file handles, network connections, and database connections. When you implement IDisposable interface, you provide a method called Dispose() that frees up these resources explicitly when the object is no longer needed. Without IDisposable interface, the garbage collector in .NET framework would eventually clean up the managed memory used by an object, but it cannot clean up unmanaged resources like file handles and network connections

Q14: Explain the difference between Managed and Unmanaged code in .NET?

In .NET, managed code is code that is executed by the Common Language Runtime (CLR), which provides a number of services such as automatic memory management, type safety, and exception handling. Managed code is compiled into an intermediate language (IL) that is executed by the CLR at runtime.On the other hand, unmanaged code is code that is executed outside of the CLR and does not rely on its services.Unmanaged code is compiled to machine code and therefore executed by the OS directly

Q15: What is Explicit Compilation

In .NET, explicit compilation refers to the process of precompiling an application’s managed code into native code, which can then be executed directly by the operating system without the need for JIT compilation. This can improve startup times and reduce memory usage, since the compiled code is already available and does not need to be generated at runtime.

Q16: What is JIT compiler

JIT (Just-In-Time) compiler is a component of the .NET runtime that compiles managed code into native machine code at runtime, just before it is executed. This contrasts with AOT (Ahead-Of-Time) compilation, which compiles code into native machine code before runtime.When a .NET application is run, the Common Language Runtime (CLR) loads the application’s managed code into memory and passes it to the JIT compiler. The JIT compiler then compiles the code into native machine code that can be executed directly by the processor. The compiled code is cached in memory so that it can be reused in subsequent executions of the application.

Q17: Does .NET support multiple inheritance?

No, .NET does not support multiple inheritance.Instead of multiple inheritance, .NET supports a mechanism called interface implementation, where a class can implement multiple interfaces. An interface defines a set of methods and properties that a class must implement. By implementing multiple interfaces, a class can inherit behavior and functionality from multiple sources.

Q18: Explain how does Asynchronous tasks Async/Await work in .NET?

When a method is marked with the “async” keyword, it indicates that the method may execute asynchronously and that it returns a Task or Task<TResult> object, which represents the asynchronous operation. When the method is called, it returns immediately, and the rest of the code continues to execute.When the async method encounters an “await” keyword, it indicates that the method should pause and wait for the result of an asynchronous operation before continuing. The “await” keyword essentially creates a callback function that is executed when the asynchronous operation completes. The method then resumes execution from where it left off, using the result of the asynchronous operation.

Q19: :Explain the difference between Task and Thread in .NET?

A Thread is a low-level construct that represents a separate path of execution within a process. Threads are managed by the operating system.Threads are typically used for long-running, CPU-bound operations.A Task, on the other hand, is a higher-level construct that represents a unit of work to be executed asynchronously. A Task can be executed on a Thread or on a ThreadPool thread, depending on the implementation. Tasks are typically used for short-running

Scroll to Top