{"id":20875342,"url":"https://github.com/aershov24/net-core-interview-questions","last_synced_at":"2025-05-12T15:31:16.876Z","repository":{"id":99971933,"uuid":"235500428","full_name":"aershov24/net-core-interview-questions","owner":"aershov24","description":"🔴 .NET Core Interview Questions and Answered to prepare for your next .NET developer interview","archived":false,"fork":false,"pushed_at":"2020-01-24T03:40:39.000Z","size":25,"stargazers_count":47,"open_issues_count":0,"forks_count":15,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-01T07:25:17.479Z","etag":null,"topics":["csharp","interview-practice","interview-preparation","interview-questions","interview-test","net-core","net-framework"],"latest_commit_sha":null,"homepage":"https://www.fullstack.cafe/.NET%20Core","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aershov24.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-22T04:46:46.000Z","updated_at":"2025-02-20T13:54:48.000Z","dependencies_parsed_at":"2023-05-11T08:45:33.242Z","dependency_job_id":null,"html_url":"https://github.com/aershov24/net-core-interview-questions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aershov24%2Fnet-core-interview-questions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aershov24%2Fnet-core-interview-questions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aershov24%2Fnet-core-interview-questions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aershov24%2Fnet-core-interview-questions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aershov24","download_url":"https://codeload.github.com/aershov24/net-core-interview-questions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253765841,"owners_count":21960804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","interview-practice","interview-preparation","interview-questions","interview-test","net-core","net-framework"],"created_at":"2024-11-18T06:44:08.077Z","updated_at":"2025-05-12T15:31:16.861Z","avatar_url":"https://github.com/aershov24.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# .NET Core Interview Questions And Answers\n\nThe sun is setting on .NET Framework. From now on, .NET Core is king. New projects, be they web or desktop, should be started in .NET Core. Stay prepared for your next .NET Core Tech Interview with our list of top .NET Core interview questions and answers.\n\n\u003e You could also find all the answers here 👉 https://www.fullstack.cafe/.NET%20Core.\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.fullstack.cafe\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/13550565/73042889-e7533900-3e9d-11ea-94f2-b4a9e87cc018.png\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Q1: What is .NET Core? ⭐\n\n**Answer:**\n\nThe .NET Core platform is a new .NET stack that is optimized for open source development and agile delivery on NuGet. \n\n.NET Core has two major components. It includes a small runtime that is built from the same codebase as the .NET Framework CLR. The .NET Core runtime includes the same GC and JIT (RyuJIT), but doesn’t include features like Application Domains or Code Access Security. The runtime is delivered via NuGet, as part of the ASP.NET Core package.\n\n.NET Core also includes the base class libraries. These libraries are largely the same code as the .NET Framework class libraries, but have been factored (removal of dependencies) to enable to ship a smaller set of libraries. These libraries are shipped as `System.*` NuGet packages on NuGet.org.\n\n🔗 **Source:** [stackoverflow.com](https://stackoverflow.com/questions/26908049/what-is-net-core)\n\n\n## Q2: What is the difference between String and string in C#? ⭐\n\n**Answer:**\n\n`string` is an alias in C# for `System.String`. So technically, there is no difference. It's like `int` vs. `System.Int32`.\n\nAs far as guidelines, it's generally recommended to use `string` any time you're referring to an object.\n```csharp\nstring place = \"world\";\n```\n\nLikewise, it's generally recommended to use `String` if you need to refer specifically to the class.\n```csharp\nstring greet = String.Format(\"Hello {0}!\", place);\n```\n\n🔗 **Source:** [blogs.msdn.microsoft.com](https://stackoverflow.com/questions/618535/difference-between-decimal-float-and-double-in-net)\n\n\n## Q3: What is the .NET Framework? ⭐\n\n**Answer:**\n\nThe .NET is a Framework, which is a collection of classes of reusable libraries given by Microsoft to be used in other .NET applications and to develop, build and deploy many types of applications on the Windows platform including the following:\n\n*   Console Applications\n*   Windows Forms Applications\n*   Windows Presentation Foundation (WPF) Applications\n*   Web Applications\n*   Web Services\n*   Windows Services\n*   Services-oriented applications using Windows Communications Foundation (WCF)\n*   Workflow-enabled applications using Windows Workflow Foundation(WF)\n\n🔗 **Source:** [c-sharpcorner.com](https://www.c-sharpcorner.com/UploadFile/8ef97c/interview-question-on-net-framework-or-clr/)\n\n\n## Q4: What is .NET Standard? ⭐\n\n**Answer:**\n\nThe **.NET Standard** is a formal specification of .NET APIs that are intended to be available on all .NET implementations.\n\n🔗 **Source:** [docs.microsoft.com](https://docs.microsoft.com/en-us/dotnet/standard/net-standard)\n\n\n## Q5: What is the difference between .NET Core and Mono? ⭐⭐\n\n**Answer:**\n\nTo be simple:\n* Mono is third party implementation of .Net Framework for Linux/Android/iOs\n* .Net Core is Microsoft's own implementation for same.\n\n🔗 **Source:** [stackoverflow.com](https://stackoverflow.com/questions/37738106/net-core-vs-mono)\n\n\n## Q6: What are some characteristics of .NET Core? ⭐⭐\n\n**Answer:**\n\n* **Flexible deployment**: Can be included in your app or installed side-by-side user- or machine-wide.\n\n* **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.\n\n* **Command-line tools**: All product scenarios can be exercised at the command-line.\n\n* **Compatible**: .NET Core is compatible with .NET Framework, Xamarin and Mono, via the .NET Standard Library.\n\n* **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.\n\n* **Supported by Microsoft**: .NET Core is supported by Microsoft, per .NET Core Support\n\n🔗 **Source:** [stackoverflow.com](https://stackoverflow.com/questions/26908049/what-is-net-core)\n\n\n## Q7: What's the difference between SDK and Runtime in .NET Core? ⭐⭐\n\n**Answer:**\n\n* The SDK is all of the stuff that is needed/makes developing a .NET Core application easier, such as the CLI and a compiler.\n\n* The runtime is the \"virtual machine\" that hosts/runs the application and abstracts all the interaction with the base operating system.\n\n🔗 **Source:** [stackoverflow.com](https://stackoverflow.com/questions/47733014/whats-the-difference-between-sdk-and-runtime-in-net-core)\n\n\n## Q8: What is the difference between decimal, float and double in .NET?  ⭐⭐\n\n**Questions Details:**\n\nWhen would someone use one of these?\n\n\n**Answer:**\n\nPrecision is the main difference.\n\n* Float - 7 digits (32 bit)\n* Double-15-16 digits (64 bit)\n* Decimal -28-29 significant digits (128 bit)\n\nAs for what to use when:\n\n* For values which are \"naturally exact decimals\" it's good to use decimal. This is usually suitable for any concepts invented by humans: financial values are the most obvious example, but there are others too. Consider the score given to divers or ice skaters, for example.\n\n* For values which are more artefacts of nature which can't really be measured exactly anyway, float/double are more appropriate. For example, scientific data would usually be represented in this form. Here, the original values won't be \"decimally accurate\" to start with, so it's not important for the expected results to maintain the \"decimal accuracy\". Floating binary point types are much faster to work with than decimals.\n\n🔗 **Source:** [blogs.msdn.microsoft.com](https://stackoverflow.com/questions/618535/difference-between-decimal-float-and-double-in-net)\n\n\n## Q9: What is an unmanaged resource?  ⭐⭐\n\n**Answer:**\n\nUse that rule of thumb: \n* If you found it in the Microsoft .NET Framework: _it's managed_. \n* If you went poking around MSDN yourself, _it's unmanaged_. \n\nAnything you've used P/Invoke calls to get outside of the nice comfy world of everything available to you in the .NET Framwork is unmanaged – and you're now _responsible_ for cleaning it up.\n\n🔗 **Source:** [stackoverflow.com](https://stackoverflow.com/questions/538060/proper-use-of-the-idisposable-interface)\n\n\n## Q10: What is MSIL? ⭐⭐\n\n**Answer:**\n\nWhen we compile our .NET code then it is not directly converted to native/binary code; it is first converted into intermediate code known as MSIL code which is then interpreted by the CLR. MSIL is independent of hardware and the operating system. Cross language relationships are possible since MSIL is the same for all .NET languages. MSIL is further converted into native code.  \n\n🔗 **Source:** [c-sharpcorner.com](https://www.c-sharpcorner.com/UploadFile/8ef97c/interview-question-on-net-framework-or-clr/)\n\n\n## Q11: What is a .NET application domain? ⭐⭐\n\n**Answer:**\n\nIt is an isolation layer provided by the .NET runtime. As such, App domains live with in a process (1 process can have many app domains) and have their own virtual address space.\n\nApp domains are useful because:\n\n* They are less expensive than full processes\n* They are multithreaded\n* You can stop one without killing everything in the process\n* Segregation of resources/config/etc\n* Each app domain runs on its own security level\n\n🔗 **Source:** [stackoverflow.com](https://stackoverflow.com/questions/1094478/what-is-a-net-application-domain)\n\n\n## Q12: Name some CLR services? ⭐⭐\n\n**Answer:**\n\n**CLR services**\n\n*   Assembly Resolver\n*   Assembly Loader\n*   Type Checker\n*   COM marshalled\n*   Debug Manager\n*   Thread Support\n*   IL to Native compiler\n*   Exception Manager\n*   Garbage Collector\n\n🔗 **Source:** [c-sharpcorner.com](https://www.c-sharpcorner.com/UploadFile/8ef97c/interview-question-on-net-framework-or-clr/)\n\n\n## Q13: What is CLR? ⭐⭐\n\n**Answer:**\n\nThe **CLR** stands for Common Language Runtime and it is an Execution Environment. It works as a layer between Operating Systems and the applications written in .NET languages that conforms to the Common Language Specification (CLS). The main function of Common Language Runtime (CLR) is to convert the Managed Code into native code and then execute the program.\n\n🔗 **Source:** [c-sharpcorner.com](https://www.c-sharpcorner.com/UploadFile/8ef97c/interview-question-on-net-framework-or-clr/)\n\n\n## Q14: What is CTS? ⭐⭐\n\n**Answer:**\n\nThe **Common Type System (CTS)** standardizes the data types of all programming languages using .NET under the umbrella of .NET to a common data type for easy and smooth communication among these .NET languages. \n\nCTS is designed as a singly rooted object hierarchy with `System.Object` as the base type from which all other types are derived. CTS supports two different kinds of types: \n\n1. **Value Types**: Contain the values that need to be stored directly on the stack or allocated inline in a structure. They can be built-in (standard primitive types), user-defined (defined in source code) or enumerations (sets of enumerated values that are represented by labels but stored as a numeric type).\n2. **Reference Types**: Store a reference to the value‘s memory address and are allocated on the heap. Reference types can be any of the pointer types, interface types or self-describing types (arrays and class types such as user-defined classes, boxed value types and delegates).\n\n🔗 **Source:** [c-sharpcorner.com](https://www.c-sharpcorner.com/UploadFile/8ef97c/interview-question-on-net-framework-or-clr/)\n\n\n## Q15: What is .NET Standard and why we need to consider it? ⭐⭐\n\n**Answer:**\n\n 1. **.NET Standard** solves the code sharing problem for .NET developers across all platforms by bringing all the APIs that you expect and love across the environments that you need: desktop applications, mobile apps \u0026 games, and cloud services:\n 2. **.NET Standard** is a **set of APIs** that **all** .NET platforms **have to implement**. This **unifies the .NET platforms** and **prevents future fragmentation**.\n 3. **.NET Standard 2.0** will be implemented by **.NET Framework**, .**NET Core**,\n    and **Xamarin**. For **.NET Core**, this will add many of the existing APIs\n    that have been requested.\n 3. **.NET Standard 2.0** includes a compatibility shim for **.NET Framework** binaries, significantly increasing the set of libraries that you can reference from your .NET Standard libraries.\n 4. **.NET Standard** **will replace Portable Class Libraries (PCLs)** as the\n    tooling story for building multi-platform .NET libraries.\n\n\u003cdiv class=\"text-center\"\u003e\n\u003cimg src=\"https://i.stack.imgur.com/tE1ny.png\" class=\"img-fluid\" style=\"max-width: 500px;\"/\u003e\n\u003c/div\u003e\n\n🔗 **Source:** [stackoverflow.com](https://stackoverflow.com/questions/42939454/what-is-the-difference-between-net-core-and-net-standard-class-library-project)\n\n\n## Q16: What is Kestrel? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q17: Talk about new .csproj file? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q18: What about NuGet packages and packages.config? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q19: What is difference between .NET Core and .NET Framework? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q20: Explain what is included in .NET Core? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q21: What is .NET Standard? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q22: What's the difference between .NET Core, .NET Framework, and Xamarin? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q23: Explain two types of deployment for .NET Core applications ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q24: What is CoreCLR? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q25: Is there a way to catch multiple exceptions at once and without code duplication? ⭐⭐⭐\n\n**Questions Details:**\n\nConsider:\n```csharp\ntry\n{\n    WebId = new Guid(queryString[\"web\"]);\n}\ncatch (FormatException)\n{\n    WebId = Guid.Empty;\n}\ncatch (OverflowException)\n{\n    WebId = Guid.Empty;\n}\n```\nIs there a way to catch both exceptions and only call the `WebId = Guid.Empty` call once?\n\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q26: Why to use of the IDisposable interface? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q27: Explain the difference between Task and Thread in .NET ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q28: What is FCL? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q29: What's is BCL? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q30: What is implicit compilation? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q31: What is JIT compiler? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q32: What is Explicit Compilation? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q33: What are the benefits of explicit compilation? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q34: What does Common Language Specification (CLS) mean? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q35: Explain the difference between “managed” and “unmanaged” code? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q36: What is the difference between .NET Standard and PCL (Portable Class Libraries)? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q37: What is the difference between Class Library (.NET Standard) and Class Library (.NET Core)? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q38: When should we use .NET Core and .NET Standard Class Library project types? ⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q39: What is the difference between .NET Framework/Core and .NET Standard Class Library project types? ⭐⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q40: What's the difference between RyuJIT and Roslyn? ⭐⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q41: Explain how does Asynchronous tasks (Async/Await) work in .NET? ⭐⭐⭐⭐\n\n**Questions Details:**\n\nConsider:\n```csharp\nprivate async Task\u003cbool\u003e TestFunction()\n{\n  var x = await DoesSomethingExists();\n  var y = await DoesSomethingElseExists();\n  return y;\n}\n```\nDoes the second `await` statement get executed right away or after the first `await` returns?\n\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q42: What are benefits of using JIT? ⭐⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q43: Why does .NET use a JIT compiler instead of just compiling the code once on the target machine? ⭐⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q44: What is the difference between CIL and MSIL (IL)? ⭐⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q45: What is the difference between AppDomain, Assembly, Process, and a Thread? ⭐⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q46: Why does .NET Standard library exist? ⭐⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q47: How to choose the target version of .NET Standard library? ⭐⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q48: Explain Finalize vs Dispose usage? ⭐⭐⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q49: What is the difference between Node.js async model and async/await in .NET? ⭐⭐⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q50: How many types of JIT Compilations do you know? ⭐⭐⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n## Q51: Could you name the difference between .Net Core, Portable, Standard, Compact, UWP, and PCL? ⭐⭐⭐⭐⭐\n\n See 👉 **[Answer](https://www.fullstack.cafe/.NET%20Core)**\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faershov24%2Fnet-core-interview-questions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faershov24%2Fnet-core-interview-questions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faershov24%2Fnet-core-interview-questions/lists"}