Basic .Net Interview Questions & Answers
(1) Why .NET Framework?
Dot NET Framework is the most powerful development platform for building a variety of solutions on Windows.
For example, using the .NET Framework, you can create applications for Windows Desktop, Web applications, Windows Phone applications, Windows Store applications, Windows Server, Windows Azure (cloud) as well as Both frameworks and cognitive services.
Before exploring the .NET Framework, we first have to understand the issues/pain areas which developers have faced in other technologies -
Under .NET Framework, many of these problems have been addressed and resolved. Microsoft .NET Framework provides a huge no. of benefits compared with the legacy languages -
(2) What is BCL?
The Base Class Library is a Common Language Infrastructure. BCL encapsulates a large number of common functionalities which are available to all the .NET Languages. BCL makes the developers life much simpler while implementing various functionalities like I/O operations, Data access operations, graphical user interfaces and interfaces to various hardware devices by encapsulating them into various namespaces and classes. It also encapsulates the services which are required by the latest real world applications. .NET Framework applications, components and the controls are built on BCL.
(3) Explain CLR, CTS, CLS under .NET Framework?
Common Language Runtime is one of the main building blocks of Microsoft .NET Framework which is responsible for performing various operations under .NET Framework.
When you design the application using Microsoft .NET languages like C#.NET or VB.NET, the language has its own complier which compiles the code into common format that is CIL [Common Intermediate Language]. Then CIL gets targeted to CLR which in turn performs many operations. It converts CIL into Native code with the help of JIT.
CLR:- also performs various other operations like Memory Management, Application Execution, Thread Management, Security checks, load the required assemblies and their types. The code which is managed by CLR is also known as Managed Code. All the managed languages are handled by a single runtime that is CLR.
Common Type System (CTS):- defines how the types are defined and used in the Common Language Runtime. CTS provides cross-language integration, type safety, and high-performance code execution. The Common Type System for language integration works as follows -
When you define an integer variable in VB.NET and declare integer in C#.NET, both the languages share the same type which is Int32, available under .NET Framework. CTS defines rules which must be followed by languages in order to make objects written in one language callable in other languages.
Microsoft .NET Framework provides various primitive data types which can be used while developing applications using various languages.
Common Language Specification (CLS) is a set of rules. CLS rules also define a subset of CTS. By defining components using CLS features only, developers are guaranteed to make use of these components in all the other languages which are CLS compliant languages. Most of the types which are defined under .NET framework are CLS complaint.
(4) What are the different versions of .NET Framework?
Following are the different versions of the Microsoft .NET Framework -
There are two more versions of .NET Framework released after v4.5. .NET Framework 4.6 was released in July 2015 and came with support for a new just-in-time compiler (JIT) for 64-bit systems called RyuJIT. .NET Framework 4.6.1 was announced in November 2015.
(5) What is an application server? As defined in Wikipedia, an application server is a software engine that delivers applications to client computersor devices. The application server runs your server code. Some well known application servers are IIS (Microsoft), WebLogic Server (BEA), JBoss (Red Hat), WebSphere (IBM).
(6) Compare C# and VB.NET
Dot NET Framework is the most powerful development platform for building a variety of solutions on Windows.
For example, using the .NET Framework, you can create applications for Windows Desktop, Web applications, Windows Phone applications, Windows Store applications, Windows Server, Windows Azure (cloud) as well as Both frameworks and cognitive services.
Before exploring the .NET Framework, we first have to understand the issues/pain areas which developers have faced in other technologies -
- Programming with Win32 API - Earlier we were using Win32 API and C language. This paradigm does not offer Object Oriented Features as C is a structured language. There is no better way of memory management either as it is done manually. Using Pointers is a big pain area for developers.
- Programming with VC++ - Many of us use C++ and MFS as a programming language which offers the features of Object Oriented Features. However C++ is built on top of C language and hence the development can still cumbersome for many novice programmers who are dealing with memory management and pointers.
- Programming with Visual Basic 6.0 - Way back in 1998, VB 6.0 as a development language had made development efforts easier. For example designing complex UI, Data Centric applications and much more. But VB 6.0 is not an object oriented language and is outdated now. When designing Multi-threaded application, we still have to go back to Win32 APIs.
- Programming with COM - Component Object Model is a specification which is used for developing reusable components which can be called across the languages like VC++, Delphi. But with COM we also get "DLL Hell". DLL Hell is the issue of maintaining multiple versions of a component for multiple applications.
Under .NET Framework, many of these problems have been addressed and resolved. Microsoft .NET Framework provides a huge no. of benefits compared with the legacy languages -
- No more COM Specifications in .NET. So, we automatically get away from DLL Hell.
- Microsoft .NET supports language integration.
- Microsoft .NET Base Class Library offers a wrapper over many raw API calls which can be used in various .NET Languages.
- You can call COM components in .NET and .NET Components in COM using interoperability. A single framework to develop Windows/Web applications.
- A Common Runtime Engine shared by all the .NET Languages.
- We have no. of languages which make developers to adapt the .NET Framework for application development.
(2) What is BCL?
The Base Class Library is a Common Language Infrastructure. BCL encapsulates a large number of common functionalities which are available to all the .NET Languages. BCL makes the developers life much simpler while implementing various functionalities like I/O operations, Data access operations, graphical user interfaces and interfaces to various hardware devices by encapsulating them into various namespaces and classes. It also encapsulates the services which are required by the latest real world applications. .NET Framework applications, components and the controls are built on BCL.
(3) Explain CLR, CTS, CLS under .NET Framework?
Common Language Runtime is one of the main building blocks of Microsoft .NET Framework which is responsible for performing various operations under .NET Framework.
When you design the application using Microsoft .NET languages like C#.NET or VB.NET, the language has its own complier which compiles the code into common format that is CIL [Common Intermediate Language]. Then CIL gets targeted to CLR which in turn performs many operations. It converts CIL into Native code with the help of JIT.
CLR:- also performs various other operations like Memory Management, Application Execution, Thread Management, Security checks, load the required assemblies and their types. The code which is managed by CLR is also known as Managed Code. All the managed languages are handled by a single runtime that is CLR.
Common Type System (CTS):- defines how the types are defined and used in the Common Language Runtime. CTS provides cross-language integration, type safety, and high-performance code execution. The Common Type System for language integration works as follows -
When you define an integer variable in VB.NET and declare integer in C#.NET, both the languages share the same type which is Int32, available under .NET Framework. CTS defines rules which must be followed by languages in order to make objects written in one language callable in other languages.
Microsoft .NET Framework provides various primitive data types which can be used while developing applications using various languages.
Common Language Specification (CLS) is a set of rules. CLS rules also define a subset of CTS. By defining components using CLS features only, developers are guaranteed to make use of these components in all the other languages which are CLS compliant languages. Most of the types which are defined under .NET framework are CLS complaint.
(4) What are the different versions of .NET Framework?
Following are the different versions of the Microsoft .NET Framework -
There are two more versions of .NET Framework released after v4.5. .NET Framework 4.6 was released in July 2015 and came with support for a new just-in-time compiler (JIT) for 64-bit systems called RyuJIT. .NET Framework 4.6.1 was announced in November 2015.
(5) What is an application server? As defined in Wikipedia, an application server is a software engine that delivers applications to client computersor devices. The application server runs your server code. Some well known application servers are IIS (Microsoft), WebLogic Server (BEA), JBoss (Red Hat), WebSphere (IBM).
(6) Compare C# and VB.NET
Next Topic | CSharp Interview Question |
---|