DotNet Core interview questions and answers

Question 1:  What is .Net core?
Answer: .NET Core is an open-source, general-purpose development platform maintained by Microsoft and the .NET community on GitHub. It's cross-platform (supporting Windows, macOS, and Linux) and can be used to build devices, cloud, and IoT applications.

Question 2: Characteristics of .NET Core?
1-      Open-source
2-       Cross-platform (supports three OS window, Linux, MacOS)
3-      Flexible deployment (two types of deployments Framework-dependent deployment, Self -contained deployment)
4-      Command-line tools
5-      compatible
6-      Modular.

Question 3: What are the main parts of .net core Platform?
1-      .Net Runtime,
2-      Fundamental Libraries,
3-      SDK & Compiler,
4-      ‘dot-net’ app host  

Question 4: What is Supported Windows Versions?
Answer: .NET Core is supported on the following versions of Windows −
·         Windows 7 SP1
·         Windows 8.1
·         Windows 10
·         Windows Server 2008 R2 SP1 (Full Server or Server Core)
·         Windows Server 2012 SP1 (Full Server or Server Core)
·         Windows Server 2012 R2 SP1 (Full Server or Server Core)
·         Windows Server 2016 (Full Server, Server Core or Nano Server)

Question 5: What are the Dependencies in dot net core?
Question 6: how to understand by Prerequisites with Visual Studio? 

Question 7: How to install Visual Studio?
Answer: After installation of Visual Studio’s latest version (VS 2015—VS2019) the dot-net core user can start building a new .NET Core Application. It provides a full-featured development environment  
Question 9: Describe the Integral types and their size?
Answer:  The following table represents the integral types and their size;
Signed/ Unsigned
Size (bytes)
Minimum Value
Maximum Value

Question 10: Explain the signed and unsigned integers in dot net core?
Answer: The primitive data types prefixed with "u" are unsigned versions with the same bit sizes. Effectively, this means they cannot store negative numbers, but on the other hand they can store positive numbers twice as large as their signed counterparts. The signed counterparts do not have "u" prefixed.
The limits for int (32 bit) are:
int: –2147483648 to 2147483647
uint: 0 to 4294967295

Question 11: What is the range of Integral types in dot net core?
Answer: one byte to eight bytes in length.
Question 12: How many Floating-point types and sized are used in dot net core?
Answer: .NET Core includes three primitive floating-point types, which are shown in the following table.
Size (bytes)
Minimum Value
Maximum Value
−79,228,162,514,264,337,593,5 43,950,335
79,228,162,514,264,337,593,543,9 50,335

Question 13: Can dot-net user work with the individual bits in double and single values by using the BitConverter class?
Answer: Yes

Question 14: What is the Decimal structure methods?
Answer: In C#, Decimal Struct class is used to represent a decimal floating-point number. The range of decimal numbers is +79,228,162,514,264,337,593,543,950,335 to -79,228,162,514,264,337,593,543,950,335. Due to its wide range, it is generally used for financial calculations which required large numbers of significant integral and fractional digits and no round-off errors. You can also perform the mathematical operations on Decimal type like addition, subtraction, division, multiplication, etc.

Question 15: What type of operator’s floating-point type supports?
Answer: Each floating-point type supports a standard set of arithmetic, comparison, equality, explicit conversion, and implicit conversion operators.

Question 16: What type of BigInteger and what represents?
Answer: System.Numerics.BigInteger is an immutable type that represents an arbitrarily large integer whose value in the theory has no upper or lower bounds.

Question 17: What type of methods BigInteger has?
Answer: The methods of the BigInteger type are closely parallel to those of the other integral types.

Question 18: What is the complex and supporting methods?
  1. The System.Numerics.Complex type represents a complex number, i.e., a number with a real number part and an imaginary number part
  2. It supports a standard set of arithmetic, comparison, equality, explicit conversion, and implicit conversion operators, as well as mathematical, algebraic, and trigonometric methods.

Question 19: What type of SIMD-enabled the vector in .NET Core?
Answer: The SIMD-enabled vector types in .NET Core include the following −
  1. System.Numerics.Vector2, System.Numerics.Vector3, and System.Numerics.Vector4 types, which are 2, 3, and 4-dimensional vectors of type Single.
  2. The Vector <T> structure that allows you to create a vector of any primitive numeric type. The primitive numeric types include all numeric types in the System namespace except for Decimal.
  3. Two matrix types, System.Numerics.Matrix3×2, which represents a 3×2 matrix; and System.Numerics.Matrix4×4, which represents a 4×4 matrix.
  4. The System.Numerics.Plane type, which represents a three-dimensional plane, and the System.Numerics.Quaternion type, which represents a vector that is used to encode three-dimensional physical rotations. 

Question 20: What is garbage collection?
Answer: The garbage collector (GC) manages the allocation and release of memory. The garbage collector serves as an automatic memory manager.

Question 21: What is Zero Garbage Collectors?
Answer: Zero Garbage Collectors is the simplest possible implementation that in fact does almost nothing. It only allows you to allocate objects because this is obviously required by the Execution Engine. Created objects are never automatically deleted and theoretically, no longer needed memory is never reclaimed.

Question 22: Explain a simple GC implementation?
Answer: it is an excellent basis for the development of your own Garbage Collection mechanism. It provides the necessary functionality to make runtime work properly and you can build on top of that.
It may be interesting for special use cases like very short living applications or such that almost no allocate memory (you can come up with those concepts as No-alloc or Zero-alloc programming). In such a case providing GC overhead is unnecessary and it may be wise to get rid of it. It is like making huge GC.TryStartNoGCRegion overall your application.

Question 23: What is the process of garbage collection?
Answer: When there isn’t enough memory to allocate an object, the GC must collect and dispose of garbage memory to make memory available for new allocations. This process is known as garbage collection.

Question 24: Do you need to know how to allocate and release memory or manage the lifetime of the objects that use that memory?
Answer: You do not need to know how to allocate and release memory or manage the lifetime of the objects that use that memory

Question 25: Advantages of Garbage Collection?
Answer: Advantages of Garbage Collection
Garbage Collection provides the following benefits -
  • You don’t need to free the memory manually while developing your application.
  • It also allocates objects on the managed heap efficiently.
  • When objects are no longer used then it will reclaim those objects by clearing their memory, and keeps the memory available for future allocations.
  • Managed objects automatically get clean content to start with, so their constructors do not have to initialize every data field.
  • It also provides memory safety by making sure that an object cannot use the content of another object.

Question 26: What conditions are true when Garbage collection occurs?
Answer: Garbage collection occurs when one of the following conditions is true.
  1. The system has low physical memory.
  2. The memory that is used by allocated objects on the managed heap surpasses an acceptable threshold. This threshold is continuously adjusted as the process runs.
  3. The GC.Collect method is called and in almost all cases, you do not have to call this method, because the garbage collector runs continuously. This method is primarily used for unique situations and testing.

Question 27: What is GC.Collect method?
Answer: The GC.Collect method is called and in almost all cases, you do not have to call this method, because the garbage collector runs continuously. This method is primarily used for unique situations and testing.

Question 28: How many generations in .NET Garbage Collector and name of each generation?
Answer: The .NET Garbage Collector has 3 generations
  1. Generation First (0)
  2. Generation Second (1)
  3. Generation Third (2)

Question 29: LOH?
Answer: Large Object Heap (LOH)

Question 30: Which Garbage Collection Generation is quick to collect objects?
Answer: Generation First (0) and Generation Second (1) is quick to collect objects because of its associated heap is small.

Question 31: Large server programs heaps?.
Answer: Large server programs are known to have heaps in the 10s of GBs.

Question 32: How many steps in the managed execution process?
  1. Choosing a compiler
  2. Compiling your code to MSIL
  3. Compiling MSIL to native code
  4. Running code

Question 33: how to understand by Choosing a Compiler
  1. It is a multi-language execution environment, the runtime supports a wide variety of data types and language features.
  2. To obtain the benefits provided by the common language runtime, you must use one or more language compilers that target the runtime.

Question 34: What is Compiling your code to MSIL?
Answer: Compiling translates your source code into Microsoft Intermediate Language (MSIL) and generates the required metadata.

Question 35: What Metadata describes?
Answer: Metadata describes the types in your code, including the definition of each type, the signatures of each type's members, the members that your code references, and other data that the runtime uses at execution time.
The runtime locates and extracts the metadata from the file as well as from framework class libraries (FCL) as needed during execution.

Question 36: What is FCL?
Answer: Framework Class Libraries (FCL)- The Framework class library (FCL) is a comprehensive collection of reusable types including classes, interfaces and data types included in the .NET-Framework to provide access to system functionality.

Question 37: What is Compiling MSIL to Native Code?
Answer: At execution time, a just-in-time (JIT) compiler translates the MSIL into native code.
During this the compilation, code must pass a verification process that examines the MSIL and metadata to find out whether the code can be determined to be type-safe.

Question 38: What is Running Code?
Answer: The common language runtime provides the infrastructure that enables the execution to take place and services that can be used during execution.
During execution, managed code receives services such as garbage collection, security, interoperability with unmanaged code, cross-language debugging support, and enhanced deployment and versioning support.

Question 39: What is the name new series of compilers in Dot net core?
Answer: In .NET Core now we have a new series of compilers, like we have Roslyn for C# and VB.

Question 40: What is the CoreFx?
Answer: CoreFx is the reimplementation of the class libraries for .NET Core.

Question 41: Why Dotnet core use different set of libraries?
Answer: In .NET Core, we don’t have the framework class libraries (FCL), so a different set of libraries are used and we now have CoreFx.

Question 42: What is the name of the new Run time with Dot Net Core?
Answer: We also have a new run time with .NET Core is known as CoreCLR and leverages a JIT Compiler.

Question 43: What is IGCToCLR interface?
Answer: This interface passed as an argument to the function InitializeGarbageCollector is used to communicate with the runtime. It contains quite a lot of available methods and listing them all here is pointless.

Question 44: What is IGCHeap interface?
Answer: This is the main interface representing core Garbage Collection functionality. Implementing IGCHeap requires implementing 71 methods! It can hardly be called loose coupling. Among others, the most important methods are for allocations (Alloc, AllocLHeap) and initialization (Initialize):

Question 45: What is IGCHandleManager interface?
Answer: IGCHandleManager is a second important interface required when implementing custom GC. It is representing handle manager functionality. Handles are extensively used by the runtime internally so this implementation has to do the minimum viable functionality instead of just dummy implementations, even if our application code does not use handles at all.

Question 46: One question is coming in my mind that why do we have the reimplementation of all these components that we already have in .NET framework.
Answer: So the answer is the same as why Microsoft implemented .NET Core.

Question 47: What is NuGet Package?

Question 48: what is Modularity?
Answer: Modularity leads to performance benefits and your application can run faster, especially ASP.NET Core application.

Question 49: What is Ryujit?
Answer: Dotnet Core supports four cross-platform scenarios: ASP.NET Core web apps, command-line apps, libraries, and Universal Windows Platform apps.

Question 50: .Net Core released date?
Answer:  .NET Core 2.0 was released on 14 August 2017 along with Visual Studio 2017 15.3

Question 51: .Net Core 3 Announced date?
Answer: .NET Core 3 was announced on May 7, 2018, at Microsoft Build.

Question 52: When a public preview was released?
Answer: A public preview was released on December 4, 2018. An official release is planned for 2019.

Question 53: If a dot net Core user want to develop .Net Core applications on windows then what versions he will use?
Answer: you want to develop .NET Core applications on Windows using Visual Studio, you can use the following two versions −
Visual Studio 2015
Visual Studio 2017 RC
Visual Studio 2019
Question 54: .Net core Supported Programming Languages?
Answer: .Net Core fully Supports C# and F# and partially support Visual Basic.Net. Currently, VB.NET compiles and runs on .Net Core, but the separate Visual Basic Runtime is not implemented. Microsoft announced that .NET Core 3 would include the Visual Basic Runtime. C++/CLI is not supported.

Question 55: What will .Net Core 3 the framework get support for development?
Answer: Yes .NET Core 3 the framework will get support for the development of desktop application software, artificial intelligence/machine learning and IoT apps.

Question 56: How to add packages in your .NET Core application?
Answer: We can directly go to NuGet and add package.

Question 57: What is UWP App in .Net core?
Answer: UWP apps will be able to use libraries you have created in .net core as long as you target the .netstandard1.6 (or higher) framework moniker. UWP is only for the Windows ecosystem

Question 58: UWP is known as Windows?
Answer: UWP is also known as Windows 10 UWP application.

Question 59: How to create a UWP application using .NET Core?

Question 60: Give some exceptions where UWP will run smoothly?
Answer: Following are a few exceptions where UWP will run smoothly.
  •  If you want to run it locally you must have Windows 10, you can also develop on Windows 8 and then you will need to run it on Emulator, but it is encouraged to use Windows 10.
  • For UWP the application you will also need Windows 10 SDK. Let us open Visual Studio 2015 setup and then modify Visual Studio. 
  • On select features page, scroll down and you will see Universal Windows App Development Tools

Question 61: what is MSBuild and how it works with .NET Core?
Answer: MSBuild is the build platform for Microsoft and Visual Studio. In the UWP application if you open the project folder, then you will see both project.json and *.csproj files. But if you open our previous .NET Core Console app, then you will see project.json and *.xproj files.

Question 62: What are the references between our Console app and our UWP app?
Question 63: Defines the types and methods of a class library?
  1. A class the library defines the types and methods that can be called from any application.
  2. A class the library developed using .NET Core supports the .NET Standard Library, which allows your library to be called by any .NET platform that supports that a version of the .NET Standard Library.
  3. When you finish your class library, you can decide whether you want to distribute it as a third-party component, or whether you want to include it as a component that is bundled with one or more applications.

Question 64: Define the Windows Runtime and Extension SDKs?
Answer: Windows Runtime components are self-contained objects that you can instantiate and use from any language, including C#, Visual Basic, JavaScript, and C++. In addition to the .NET Core meta-package we saw in the previous chapter, UWP app also has a reference by default to a Universal Windows SDK.

Question 65: What is open-source?
  1. .NET Core is an open-source implementation, using MIT and Apache 2 licenses.
  2. .NET Core is a .NET Foundation project and is available on GitHub.
  3. As an open source project, it promotes a more transparent development process and promotes an active and engaged community.

Question 66: Explain the Cross-platform?
Answer: Application implemented in .NET-Core can be run and its code can be reused regardless of your platform target.
It currently supports three main operating systems (OS)  
  1. Windows
  2. Linux
  3. MacOS

Question 67: Give the names of deployments for .NET Core applications
Answer: There can be two types of deployments for .NET Core applications −
  1. Framework-dependent deployment
  2. Self-contained deployment 

Question 68: How to work Framework-dependent deployment in .Net core?
Answer: your app depends on the system-wide version of .NET Core on which your app and third-party dependencies are installed.

Question 69: How to work Self-contained deployment in .Net core?
Answer: .NET Core version used to build your application is also deployed along with your app and third-party dependencies and can run side-by-side with other versions.

Question 70: What is .Net core compatible?
Answer: .NET Core is compatible with .NET-Framework, Xamarin and Mono, via the .NET Standard Library

Question 71: Give some functionalities of Modular?
  1. .NET Core is released through NuGet in smaller assembly packages.
  2. .NET-Framework is one large assembly that contains most of the core functionalities.
  3. .NET Core is made available as smaller feature-centric packages.
  4. This modular approach enables the developers to optimize their app by including just those NuGet packages which they need in their app.
  5. The benefits of a smaller app surface area include tighter security, reduced servicing, improved performance, and decreased costs in a pay-for-what-you-use model. 

Question 72: What is .Net Runtime?
Answer: .NET Runtime − It provides a type system, assembly loading, a garbage collector, native interop and other basic services.

Question 73: What are the Fundamental Libraries?
Answer: Fundamental Libraries − A set of framework libraries, which provide primitive data types, app composition types and fundamental utilities.

Question 74: What is SDK & Compiler?
Answer: SDK & Compiler − A set of SDK tools and language compilers that enable the base developer experience, available in the .NET Core SDK.

Question 75: What is ‘dot-net’ app host and what it's used?
Answer: ‘dot-net’ app host − It is used to launch .NET Core apps. It selects the runtime and hosts the runtime, provides an assembly loading policy and launches the app. The same host is also used to launch SDK tools in much the same way.

Question 76: What is .NET Core - Numerics?
Answer: .NET Core supports the standard numeric integral and floating-point primitives. It also supports the following types −
  1. System.Numerics.BigInteger which is an integral type with no upper or lower bound.
  2. System.Numerics.Complex is a type that represents complex numbers.
  3. A set of Single Instruction Multiple Data (SIMD)-enabled vector types in the System.Numerics namespace. 

Question 77: How to share your library as NuGet Package?

Question 78: What is Xamarin.Forms?
Answer: Xamarin.Forms is a framework that allows developers to rapidly create cross-platform user interfaces. Xamarin.Forms is a cross-platform natively backed UI toolkit abstraction that allows developers to easily create user interfaces that can be shared across Android, iOS, Windows, and Windows Phone.

Question 79: How to work Xamarin.Forms in dot net core?
Answer: Xamarin.Forms is a cross-platform natively backed UI toolkit abstraction that allows developers to easily create user interfaces that can be shared across Android, iOS, Windows, and Windows Phone.

Question 80: How to use the user interfaces Xamarin.Forms ?
Answer: The user interfaces are rendered using the native controls of the target platform, allowing Xamarin.Forms applications to retain the appropriate look and feel for each platform.

Question 81: What is PCL?
Answer: PCL - a .NET based library format supported by several runtime environments including .NET, Mono, Windows Phone, and so on.

Question 82: What is .Net Standard?
Answer: .NET Standard (Definition 2) - a .NET based library format supported by several runtime environments including .NET, Mono, Windows Phone, and so on which is a continuation of the PCL format. In Visual Studio, a PCL library can be converted to a .NET Standard library by going into the properties of the project and editing the target framework.

Question 83: What is unit testing?
Answer: Unit testing is a development process for the software that has the smallest testable parts of an application, which are called units. They are individually and independently scrutinized for any proper operation. Unit testing is can either be automated or done manually as well.

Question 84: What is StringLibraryTests?
Answer: Create a test folder and inside the test folder creates another folder and calls it StringLibraryTests.

Question 86: How to run tests in Visual Studio?

Question 87: What is MEF?
Answer: Managed Extensibility Framework. MEF is a library for creating lightweight, extensible applications. It allows application developers to discover and use extensions with no configuration required.

Question 88: How MEF works?
Answer: It allows application developers to discover and use extensions with no configuration required. MEF is an integral part of the .NET Framework 4 and is available wherever the .NET-Framework is used that improves the flexibility, maintainability, and testability of large applications.

Question 89: How to use MEF in .Net core?
Answer: You can use MEF in your client applications, whether they use Windows Forms, WPF, or any other technology, or in server applications that use ASP.NET. MEF has been ported as Microsoft.Composition to .NET Core as well but partially. Only System.Composition is ported, and System.ComponentModel.Composition is not available yet. This means we don’t have the catalogs which can load types from assemblies in a directory.

Question 90: Can .Net core user create mstest, web, mvc and webapi projects to use the command line?
Answer: Yes we can now create mstest, web, mvc and webapi projects as well using the command line.

Question 91: What are the advantages of drop project.json and go back to MSBuild and *.csproj?
  1. Answer:
  2. It would make the transition of the existing Visual Studio solutions to .NET Core straightforward.
  3. It is a huge change and it will also enable leveraging existing investment in CI/RM based around MSBuild.
  4. During build in MSBuild, we can think of incremental compilation, resolving BuildTime dependencies, configuration management, etc.
  5. A lot of work is required to ship dot-net CLI on time because it is no longer just about ASP.NET Core, but also console apps, UWP apps, etc. 

Question 92: What are the changes in MSBuild and *.csproj?
  • Project.json file (*.xproj) will be replaced by MSBuild (*.csproj).
  • Features in project.json will start getting merged back into the *.csproj.
  • It is not yet clear what they are going to do about the packages list, but it was mentioned they might keep it as JSON under nuget.json or merge it into the *.csproj.
  • Supposedly that transition should be smooth and potentially automatic if using Visual Studio.

Question 93: What are the Advantages of MSBuild?
  1. MSBuild is open-source and available on GitHub and is bound to become fully cross-platform.
  2. MSBuild will dramatically simplify and trim the structure of the *.csproj.
  3. Microsoft is also introducing a new project system which will enable a lot of scenarios without the need for Visual Studio and the details are given on the this Url
  4. The goal is that even with the MSBuild setup, working with builds and project will be as seamless in Visual Studio IDE as outside of it.

Question 94: How to restore and build your MSBuild (*.csproj) file using the command line utility?

Question 95: What is .NET Core - Migrations?
Answer: A data model changes during development and gets out of sync with the database. You can drop the database and let EF create a new one that matches the model, but this procedure results in the loss of data. The migrations feature in EF Core provides a way to incrementally update the database schema to keep it in sync with the application's data model while preserving existing data in the database.

Migration is a way to keep the database schema in sync with the EF Core model by preserving data.

 EF Core Migration
As per the above figure, EF Core API builds the EF Core model from the domain (entity) classes and EF Core migrations will create or update the database schema based on the EF Core model. Whenever you change the domain classes, you need to run migration to keep the database schema up to date.

EF Core migrations are a set of commands which you can execute in NuGet Package Manager Console or in dot-net Command Line Interface (CLI).

Question 96: What are Empty migrations?
Answer: Sometimes it's useful to add a migration without making any model changes. In this case, adding a new migration creates code files with empty classes. You can customize this migration to perform operations that don't directly relate to the EF Core model. Some things you might want to manage this way are:
  • Full-Text Search
  • Functions
  • Stored procedures
  • Triggers
  • Views

Question 97: What are Generate SQL scripts in .Net core?
Answer: When debugging your migrations or deploying them to a production database, it's useful to generate a SQL script. The script can then be further reviewed for accuracy and tuned to fit the needs of a production database. The script can also be used in conjunction with a deployment technology.

Question 98: Is this true Microsoft provides a free version of visual studio which also contains the SQL Server?
Answer: Yes

Question 99: What are the benefits of .Net Core?
Answer: One of the benefits of .NET-Core is the approach taken with the project file (project.json); we can just drop files into the root of our project and then these will be automatically included in our project.

Question 100: Talk About New .csproj File? 
  1. .csproj file is now used as a place where we manage the NuGet packages for your application.
  2. File explorer and project explorer are now in sync. For .NET Core projects, you can easily drop a file from file explorer into a project or delete it from the file system and it will be gone from the project. No more source files in a .csproj file.
  3. You can now edit the .csproj file directly without unloading the project.
  4. Question 101: Differences Between .net Core and .net Framework?

Question 101: Differences Between .net Core and .net Framework?
Answer: The differences between the two can be summarized in these three points:

NuGet-based: .NET Core is distributed as a set of NuGet packages that allow app-local deployments. In contrast, the .NET-Framework is always installed in a system-wide location. This difference doesn’t matter so much for class libraries, but it matters for applications as those are expected to deploy the closure of their dependencies. But we expect this model to change how quickly class library authors can take advantage of new functionality. Since the applications can simply deploy a new version (as opposed to having to wait until a given .NET Framework version is widely adopted), there is less of a penalty for component authors to take advantage of the latest features.

Well layered: .NET Core was specifically designed to be layered. The goal was to create a .NET stack that can accommodate a wide variety of capabilities and system constraints without forcing customers to recompile their binaries and/or produce new assets. This means that we had to remove certain APIs because they tied lower-level components to higher-level components. In those cases, we provide alternatives, often in the form of extension methods.

Free of problematic tech: .NET Core doesn’t include certain technologies we decided to discontinue because we found them to be problematic, for instance, AppDomain and sandboxing. If the scenario still makes sense for .NET Core, our plan is to have replacements. For example, AssemblyLoadContext replaces AppDomains for loading and isolating assemblies.

Question 102: What is the Relationship Between .net Core and .net Framework?
Answer: .NET Core and the .NET-Framework has (for the most part) a subset-superset relationship. .NET Core is named "Core" since it contains the core features from the .NET-Framework, for both the runtime and framework libraries. For example, .NET Core and the .NET Framework share the GC, the JIT, and types such as String and List

Question 103: What are technologies discontinued in the dot-net core? 
  • Reflection
  • Appdomain
  • Remoting
  • Binary serialization
  • Sandboxing

1 comment:

Please do not enter any spam link in the comment box.

Related Posts

What is the Use of isNaN Function in JavaScript? A Comprehensive Explanation for Effective Input Validation

In the world of JavaScript, input validation is a critical aspect of ensuring that user-provided data is processed correctly. One indispensa...