Dot Net Interview
Dot Net Interview
NET MCQ
1.
System.Int32
System.Int8
System.Int16
System.Int64
2.
If the exception does not occur, will the final block get executed?
Static
Serial
Local
Private
6.
RMT
CLR
RC
RCT
7.
manifest
.dll
.exe
core
8.
Value types
All data types in .net
Reference types
Communication between multiple languages
9.
System.Web
System.IO
System.Object
System.File
10.
GC.Run() method
GC.Collection() method
GC.Finalize() method
GC.Collect() method
11.
CLI tools
Roslyn
CoreFX and CoreCLR
All of the above
15.
Windows only
Cross-platform
Linux only
MacOS only
17.
What is CoreFX?
Garbage Collector
JIT Compiler
Primitive data types
All of the above
19.
What is Roslyn?
The main differences between value type and reference type are given below:
• A Value Type holds the actual data directly within the memory location and a
reference type contains a pointer which consists of the address of another memory
location that holds the actual data.
• Value type stores its contents on the stack memory and reference type stores its
contents on the heap memory.
• Assigning a value type variable to another variable will copy the value directly and
assigning a reference variable to another doesn’t copy the value, instead, it creates
a second copy of the reference.
• Predefined data types, structures, enums are examples of value types. Classes,
Objects, Arrays, Indexers, Interfaces, etc are examples of reference types.
The main difference between managed and unmanaged code is listed below:
MSIL is the Microsoft Intermediate Language, which provides instructions for calling
methods, memory handling, storing and initializing values, exception handling, and
so on.
Assemblies are implemented in the form of executable (.exe) or dynamic link library
(.dll) files.
Garbage collector frees the unused code objects in the memory. The memory heap
is partitioned into 3 generations:
The main difference between an abstract class and an interface are listed below:
Stack: Stack is a stored-value type that keeps track of each executing thread and its
location. It is used for static memory allocation.
Heap: Heap is a stored reference type that keeps track of the more precise objects
or data. It is used for dynamic memory allocation.
• Free and open-source: .NET Core source code project can be obtained from
Github. It is free and licensed under the MIT and Apache licenses.
• Cross-platform: .NET Core is supported by different operating systems like
Windows, macOS, and Linux.
• Sharable: A single consistent API model that is written in .NET Standard will be
used by .NET Core and is common for all the .NET applications. The same library or
API can be used on multiple platforms with different languages.
• Friendly: The .NET Core is compatible with .NET Framework, Mono, and Xamarin,
through .NET Standard. It also supports working with different Web frameworks
and libraries such as Angular, React, and JavaScript.
• Fast: .NET Core 3.0 is faster compared to the .NET Framework, .NET Core 2.2 and
previous versions. It is also much faster than other server-side frameworks like
Node.js and Java Servlet.
Yes, ASP.NET and ASP(Active Server Pages) both are different. Let’s check how they
are different from each other.
• ASP.NET uses .NET languages such as C# and VB.NET, which are compiled to
Microsoft Intermediate Language (MSIL). ASP uses VBScript. ASP code is
interpreted during the execution.
• ASP.NET which is developed by Microsoft is used to create dynamic web
applications while ASP is Microsoft’s server-side technology used to create web
pages.
• ASP.NET is fully object-oriented but ASP is partially object-oriented.
• ASP.NET has full XML Support for easy data exchange whereas ASP has no built-in
support for XML.
• ASP.NET uses the ADO.NET technology to connect and work with databases. ASP
uses ADO technology.
Q 4:- . What is the order of the events in a page life cycle?
There are eight events as given below that take place in an order to successfully
render a page:
• Page_PreInit
• Page_Init
• Page_InitComplete
• Page_PreLoad
• Page_Load
• Page_LoadComplete
• Page_PreRender
• Render
Session Cookie: It resides on the client machine for a single session and is valid
until the user logs out.
Persistent Cookie: It resides on the user machine for a period specified for its
expiry. It may be an hour, a day, a month, or never.
Components of MVC
Model: They hold data and its related logic. It handles the object storage and
retrieval from the databases for an application. For example:
A Controller object will retrieve the employee information from the database.
It manipulates employee data and sends back to the database or uses it to render
the same data.
View: View handles the UI part of an application. They get the information from the
models for their display. For example, any employee view will include many
components like text boxes, dropdowns, etc.
Controller: They handle the user interactions, figure out the responses for the user
input and also render the final output. For instance, the Employee controller will
handle all the interactions and inputs from the Employee View and update the
database using the Employee Model.
Q 2:-
Web API is a framework that makes it easy to build HTTP services that reach a
broad range of clients, including browsers and mobile devices. The ASP.NET Web
API is an ideal platform for building REST applications on the .NET Framework.
There are three different approaches you can use while developing your
application using Entity Framework:
Database-First
Code-First
Model-First