- What is .NET?
Ans. .Net is a software framework of Microsoft for developing the applications on Windows. It is similar to other software development frameworks like Java Platform, Enterprise Edition (J2EE), and comprises of ASP .Net, languages such as C#, VB .Net, COBOL, Perl, etc.
- What is ASP.NET?
Ans. ASP.NET is another software framework to build web applications and is a part of the .NET Framework. ASP.NET helps to build the front end and runs on IIS, a Web Server.
- What is CLR?
Ans. CLR refers to Common Language Run-time. It is an essential component of the .NET framework and can be used as a building block of various applications. An essential feature of CLR is that it ensures a secure execution environment for applications.
- What is CLS?
Ans. CLS refers to Common Language Specification. It allows users to use inter-language compatible components and helps to reuse the code in other .NET compatible language.
- Differentiate between boxing and unboxing.
Ans.
Boxing | Unboxing |
Implicit conversion | Explicit conversion |
Object type refers to the value type | Retrieve value from the boxed object |
int n = 12; | int m = (int) ob; |
- What is BCL?
Ans. BCL refers to Base Class Library. It is the foundation of .NET framework applications, components, and controls. It comprises of basic, fundamental types like System.String and System.DateTime and offers functionalities like threading, input/output, security, diagnostics, etc.
- What are cookies?
Ans. Cookies are small bits of text information. Cookies are created by the server on the client for identifying users. It may contain the username and ID, interests, password remember option, or any other information. Cookies are domain-specific.
- Name some of the disadvantages of cookies.
Ans. The main disadvantages of cookies include –
- Possible security risk, as they are stored in a clear text
- Not secure, as encryption & decryption is easy
- Cookies can be disabled on any user’s computer
- Cookies can be edited or deleted
- Cookies can store limited data.
- How many languages are supported by .NET?
Ans. .NET supports almost 60 languages, including C#.NET, VB.NET, C++.NET, J#.NET, F#.NET, JSCRIPT.NET, WINDOWS POWERSHELL, etc.
- Differentiate between ASP.NET and ASP.
Ans. Yes, ASP.NET is different from ASP. These are the main differences:
ASP.NET | Active Server Pages (ASP) |
Creates dynamic web applications | Creates web pages |
Compiled | Interpreted |
Uses ADO.NET | Uses ADO |
Completely object-oriented | Partially object-oriented |
- Explain state management in ASP.NET.
Ans. State management is the process of managing the state of one or more user interface controls such as text fields, OK buttons, radio buttons, etc. in a graphical user interface. Two types of state management systems are there in ASP.NET –
- Client-side state management
- Server-side state management
- What are the key differences between function and stored procedure in .Net programming language?
Ans. The difference between function and stored procedure:
Function | Stored procedure |
Returns only one value | Returns one or more than one value |
Used in select statements | Cannot be used in select statements |
Has only input parameter | Has both input and output parameters |
It can’t handle exceptions | It can handle exceptions using try-catch block |
- How would you retrieve user names for Windows Authentication?
Ans. User name for Windows Authentication can be retrieved by using –
System.Environment.UserName
- Name the advantages of using Session State.
Ans. The advantages of Session State include –
- Easy to implement
- Stores user states and data across the application
- Ensures data durability
- Works in multi-process configuration, thereby ensuring platform scalability
- Stores session object on the server. Keeping it secure and transparent from the user
- What is HTTPhandler?
Ans. HttpHandler is a low-level request and response API in ASP.Net. It is used by the ASP.NET web application server to handle specific extension-based requests.
- Name the methodology used to enforce garbage collection in .NET.
Ans. The methodology used to enforce garbage collection in .NET is System.GC.Collect().
- How many types of indexes are there in .NET?
Ans. There are two types of indexes in .Net:
- Clustered index
- Non-clustered index
- How many types of memories do exist in .Net?
Ans. There are two types of memories in .Net
- Stack memory
- Heap Memory
- What is IL?
Ans. IL refers to Intermediate Language and is an object-oriented programming language to be used by the compilers. IL gets changed over to byte code when a virtual machine is being executed. IL is also known as Common Intermediate Language (CIL) or Microsoft Intermediate Language (MSIL).
- What is inheritance? Explain its importance.
Ans. Inheritance is a crucial aspect of object-oriented programming that allows developers to create new classes that are built upon existing classes. This is achieved by reusing, extending, and modifying the behaviors defined in classes. The class whose members are inherited is the base class, while the class that inherits those members is called the derived class.
- What is LINQ?
Ans. LINQ notices to Language Integrated Query. It was introduced with visual studio 2008 and is a uniform query syntax in C# and VB.NET for data retrieval from different sources and data manipulation irrespective of the data source.
- Name different types of constructors in C#.
Ans. Different types of constructors in C# are –
- Copy Constructor
- Default Constructor
- Parameterized constructor
- Private Constructor
- Static Constructor
- Write the differences between Custom Control and User Control.
Ans.
Custom Control | User Control |
Inherits from the System.Windows.Controls.Control class | Inherits from the system.Windows.Controls.UserControls class |
Designed for single-application scenarios | Designed for multi-application scenarios |
Introduces redundancy and maintenance problems if used on more than one applications | Can be distributed without facing any problems associated with redundancy and maintenance |
Loosely coupled control with respect to code and UI | Tightly coupled control with respect to code and UI |
- What is Garbage Collector in .NET?
Ans. The garbage collector is responsible to free up the unused code objects in the memory. Every time a new object is created, the common language runtime allocates memory for the object.
- What are the different events in the Page Life Cycle?
Ans. Different events in the Page Life Cycle include –
- Page_PreInit
- Page_Init
- Page_InitComplete
- Page_PreLoad
- Page_Load
- Page_LoadComplete
- Page_PreRender
- Render
- Name all the templates of the Repeater control.
Ans. Templates of the Repeater control are –
- ItemTemplate
- AlternatingItemTemplate
- SeparatorTemplate
- HeaderTemplate
- FooterTemplate
- What code we can use to send e-mail from an ASP.NET application?
Ans. We can write a given code to send an e-mail:
MailMessage mailMess = new MailMessage ();
mailMess.From = “naukri@gmail.com”;
mailMess.To = “shiksha@gmail.com”;
mailMess.Subject = “Test email”;
mailMess.Body = “Hi check this test mail.”;
SmtpMail.SmtpServer = “localhost”;
SmtpMail.Send (mailMess);
MailMessage and SmtpMail are classes defined System.Web.Mail namespace.
- Explain Polymorphism?
Ans. Polymorphism is used as an interface with various functions. In this interface, a similar method or property can work on different actions depending on the run-time type of the instance.
- Mention different types of Polymorphism?
Ans. Following are two types of Polymorphism:
- Static or compile-time polymorphism
- Dynamic or runtime polymorphism
- Mention the design principles used in .NET?
Ans. In .Net, SOLID design principle is used, take a look at the following design principles:
- Open-Closed Principle (OCP)
- Single responsibility principle (SRP)
- Interface segregation principle (ISP)
- Liskov substitution principle (LSP)
- Dependency inversion principle (DIP)
- Explain what is Marshaling in .NET ?
Ans. Marshalling is defined as the process of transforming types in the managed and unmanaged code. It is the most important service given by CLR.
- What are Boxing and Unboxing?
Ans. Boxing and Unboxing are defined as a concept of C#, where a unified view of the type system is enabled to treat the value of any type as an object.
- Mention the divisions of the Memory Heap?
Ans. Following is the division of memory heap into three generations.
Generation 0 – Used to store short-lived objects. Quick Garbage Collection occurs in this Generation.
Generation 1 – Used for medium-lived objects.
Generation 2 – Used for long-lived objects.
- How do we execute managed code?
Ans. To execute managed code, we can follow these steps:
- Select a language compiler depending on the language of the code.
- Convert the code into Intermediate language using its compiler.
- The IL is then targeted to CLR which transforms the code into native code using JIT.
- Execute Native code.
- Mention the different parts of an Assembly?
Ans. Following are the different parts of an Assembly:
- Manifest – Stores the information about the version of an assembly.
- Type Metadata – Stores the binary information of the program.
- MSIL – Microsoft Intermediate Language code.
- Resources – List of related files.
- List the advantages of Web Services?
Ans. Following are the advantages of Web Services:
- It is stateless and firewall-friendly.
- It is easy to create and supported by multiple platforms.
- It can extend its interface and add new methods without affecting the client’s operations.
- What is ADO (ActiveX Data Objects)?
Ans. ADO is an application program used for writing Windows applications. It is also used to get access to a relational or non-relational database from database providers such as Microsoft and others.
- List the fundamental objects in ADO.NET?
Ans. Following are the fundamental objects in ADO.NET:
- DataReader- connected architecture
- DataSet- disconnected architecture
- What is a PE file?
Ans. PE stands for Portable Executable. It is a derivative of the Microsoft Common Object File Format (COFF). Windows executable, .EXE or DLL files follow the PE file format. It consists of four parts:
- PE/COFF headers- Contains information regarding .EXE or DLL file.
- CLR header- Contains information about CLR & memory management.
- CLR data- Contains metadata of DDLs and MSIL code generated by compilers.
- Native image section- Contains sections like .data, .rdata, .rsrc, .text etc.
- What is the difference between DLL and EXE?
Ans. .EXE files are single outbound files that cannot be shared with other applications. DLL files are multiple inbound files that are shareable.
- .NET is an OOP or an AOP framework?
Ans. .NET is an OOP framework as Encapsulation and Inheritance are key features of the Object-Oriented Programming framework.