Top 10 Interview Questions for .net
- Explain what inheritance is, and why it’s important.
- Explain the difference between a class and an object.
- Explain the difference between managed and unmanaged code.
- How does the .NET framework work?
- .NET framework-based applications that are written in supportive languages like C#, F#, or Visual basic are compiled to Common Intermediate Language (CIL).
- Compiled code is stored in the form of an assembly file that has a .dll or .exe file extension.
- When the .NET application runs, Common Language Runtime (CLR) takes the assembly file and converts the CIL into machine code with the help of the Just In Time(JIT) compiler.
- Now, this machine code can execute on the specific architecture of the computer it is running on.
- 5. What is JIT?
- What is the difference between int and Int32?
- Explain about major components of the .NET framework.
- Common Language Runtime(CLR):
- It is an execution engine that runs the code and provides services that make the development process easier.
- Services provided by CLR are memory management, garbage collection, type safety, exception handling, security, and thread management. It also makes it easier for designing the applications and components whose objects interact across the languages.
- The programs written for the .NET Framework are executed by the CLR regardless of programming language. Every .NET Framework version is having CLR.
- Framework Class Library(FCL):
- It has pre-defined methods and properties to implement common and complex functions that can be used by .NET applications. It will also provide types for dates, strings, numbers, etc.
- This class library includes APIs for database connection, file reading and writing, drawing, etc.
- Base Class Library(BCL):
- The Base Class Library(BCL) has a huge collection of libraries features and functions that are helpful in implementing various programming languages such as C#, F#, Visual C++, etc., in the .NET Framework.
- BCL is divided into two parts. They are:
- User-defined class library:It includes Assemblies.
- Predefined class library: It contains namespace.
- Common Type System(CTS):
- CTS specifies a standard that will mention which type of data and value can be defined and managed in memory during runtime.
- It will make sure that programming data defined in different languages should interact with each other for sharing the information. For example, in VB.NET we define datatype as integer, while in C# we define int as a data type.
- It can be used to prevent data loss when you are trying to transfer data from a type in one language to its equivalent type in another language.
- Common Language Specification (CLS):
- Common Language Specification (CLS) is a subset of CTS and defines a set of rules and regulations to be followed by every .NET Framework’s language.
- A CLS will support inter-operability or cross-language integration, which means it provides a common platform for interacting and sharing information. For example, every programming language(C#, F#, VB .Net, etc.) under the .NET framework has its own syntax. So when statements belonging to different languages get executed, a common platform will be provided by the CLS to interact and share the information.
- What is an EXE and a DLL?
- Is ASP.NET different from ASP? If yes, explain how?
- NET is developed by Microsoft to create dynamic web applications while ASP (Active Server Pages) is a Microsoft’s server side technology use to create web pages.
- NET is compiled while ASP is interpreted.
- ASP uses the technology named ADO while ASP.NET uses ADO.NET.
- NET is completely object oriented while ASP is partially object oriented.
- What is the state management in ASP.NET?