66 Senior .NET Developer Interview Questions & Answers | 2023

.Net is a widely used framework for developing Windows applications and encompasses languages such as C#, Cobol, Perl, VB.Net, etc. Are you looking for a job in this domain? Here is a list of expected .NET interview questions and answers to help you get through your next interview. Let’s go for it:

1. What is the .Net framework, and how does it work?

It is a virtual machine that executes managed code. The code is compiled from C# or VB .NET and is executed by the CLR (Common Language Runtime).

Its working is as follows:

  • You create a program in C # or VB.Net and compile it. The code is then translated into CIL (Common Intermediate Language).
  • The program is assembled into bytecode to generate a CLI (Common Language Infrastructure) assembly file of.exe or .dll format.
  • When you run the program (or the DLL), it is executed by the .Net framework CLR (Common Language Runtime). Since the code isn’t directly run by the operating system, it is called “Managed Code“.
  • The .Net Framework CLR, through the JIT (Just-In-Time) Compiler, is responsible for compiling this code managed in the intermediate language. The compiled code is then sent to the native machine language assembler for the CPU to execute it.

The CIL (Common Intermediate Language) is the language that understands the.Net Framework.

  • C # and VB .Net are languages that we understand as humans.
  • C # and VB .Net are translated to CIL.

Take care to remember the details. It may look like basic information, but it is among recruiters’ top senior .NET developer interview questions.

2. What are some of the key components of .NET?

Although .NET is made of several essential components, some are more common than others based on the frequency of use. Following is a list of key .NET components you must know about:

  • CLR (Common Language Runtime)
  • .NET Framework
  • .NET Library
  • Application Domain
  • Garbage Collector
  • JIT Compiler

3. What are EXE and DLL?

  1. EXE and DLL are both assembly executable modules with different capabilities.
  2. EXE is an extension for executable files that run the application for which they are developed. It defines an entry point and can run independently; however, its use is restricted to the initially designed application. Additionally, EXE always establishes a separate memory space unique to the application.
  3. DLL, in contrast, is an extension of a dynamic link library and an essential component for shared libraries. Unlike EXE, DLL can be used by other applications and does not define an entry point. Since the DLL extension is used for shared libraries, it leverages the space of the calling application.
66 Senior .NET Developer Interview Questions & Answers | 2023 1
.Exe and . Dll generated by.Net Console Application

This is an example of one of the most basic senior .NET developer interview questions, so keep the answer in mind.

4. What is a dynamic type in .NET?

Dynamic type is the opposite of static type and it is used to avoid compile-time type checking. Although it is a static type by nature, an object of dynamic type can bypass static type Checking.

Hence, instead of checking the type of the dynamic type variable at compile time, the compiler checks it at run time.

dynamic input = "Deependra";//string
input = 123;//int
input = true;//boolean
//You can assign any type to the dynamic variable.Because it will be evaluated at runtime.
Console.WriteLine(input);
Console.WriteLine(input.GetType());
//This code will run without any issue

5. What is MSIL?

Microsoft Intermediate Language (MSIL) is a type of Common Intermediate Language. At its base, it’s a set of instructions that can be converted to native code without CPU intervention. It is made of instructions for memory handling, storing and initializing values, calling methods, etc.

66 Senior .NET Developer Interview Questions & Answers | 2023 2
Code Generation lifecycle in .Net Framework

Typically, a CLR’s JIT compiler converts the MSIL code to native code during runtime.

6. What is Common Language Specification?

Common language specification (CLS) is a subset of the Common Type System. Its common language features help develop .NET compatible applications and services because they can communicate with objects designed using different languages.

66 Senior .NET Developer Interview Questions & Answers | 2023 3
Common Language Specification

Hence, CLS acts as a common ground for components, helping them fit together without disruption despite their diverse base languages.

7. What is Heap, and what is Stack?

  • Both are memory locations, wherein Heap is global, and Stack is local.
  • The Heap is application-level, while the Stack is thread-level.
  • The Stack has a defined first-in-first-out stack structure, while the Heap does not have a defined data structure.
  • Its size is defined at the time of its creation. For Heap, the size is defined when starting the application, and for Stack, when creating a thread.
  • Both can grow dynamically.
  • The Stack is faster than the Heap. A stack is in “cache” and doesn’t have to synchronize with other threads like the Heap.
  • The Stack stores values while the Heap stores objects.
Heap vs Stack in .NET
Heap vs Stack

8. What is a Garbage Collector?

A Garbage Collector is an automatic process of memory release. When memory goes low, it goes through the Heap and eliminates the objects no longer in use. It frees up memory, reorganizes remaining threads, and adjusts pointers to these objects, both in Heap and Stack.

9. What are the three generations of garbage collection?

As mentioned above, the Garbage Collector helps free up memory space by disposing of unused objects when memory becomes low. The memory head a garbage collector typically deals with is categorized into three generations:

  • Generation 0: This generation contains the newest or most short-lived objects. They are collected fairly frequently and efficiently.
  • Generation 1: Contains objects that have been present long enough to be marked for collection but have not been collected due to sufficient heap space. They are removed less frequently than Generation 0, and the process is less efficient.
  • Generation 2: Contains objects that have remained in memory for the longest period. Collection for Generation 2 objects happens even less frequently than in Generation 1, with the ideal ratio for 1 and 2 being 10:1.

10. What is a delegate?

It is the definition of a method that encapsulates certain arguments and types of return. It allows passing a method as an argument of a function, as long as it matches its specific signature.

var fileDownloader = new FileDownloader();
fileDownloader.DownloadFile("",PrintDownloadCompleted);

void PrintDownloadCompleted()
{
    Console.WriteLine("Download Completed");
}

public class FileDownloader
{
    public delegate void DownloadCompleted();
    
    //Method takes delegate as parameter,
    //Where caller can pass the function referenced which returns void and take no parameter
    public void DownloadFile(string url, DownloadCompleted downloadCompleted)
    {
        //Perform the download in async mode,once completed callback the downloadcompleted method
        downloadCompleted.Invoke();
    }
}

11. What is CTS?

Common Type System or CTS is a standard that specifies how types are represented and managed in common language runtime. It provides the core support for cross-language integration, making it essential for application development.

  • There are a few key roles a CTS performs in a .NET framework:
  • Define common rules for all languages to follow to ensure they can interact when used in a single application.
  • Create a framework to support cross-language integration in code execution.
  • Develop a model for the implementation of multiple programming languages in addition to creating a library with primitive data types.

12. What is LINQ?

It is standardization to consult data and convert it into objects, regardless of the source. It is a query manager for databases, XML, and enumerable collections using a single language.

var oddNumbers = new[] {1, 3, 5, 7, 9};

var firstNumber = oddNumbers.First();//Linq Query to take only first number
var secondNumber = oddNumbers.Skip(1).First();//Linq Query to take second number
var onlyThreeNumbers = oddNumbers.Take(3);//Linq Query to take only three numbers
var lastNumber = oddNumbers.Last();//Linq Query to take only last number
var numbersGtFive = oddNumbers.Where(x => x > 4); //Linq Query to take only numbers 
greater then 5

13. How does LINQ work?

Internally build the correct query (in the case of databases) or generate the corresponding operations on the collections or parse the XML and returns the relevant data. It encapsulates all these behaviors and provides a single implementation. In this way, we can use the same queries, and the same language, independently of the underlying data source.

14. What are the deferred execution and the immediate execution in LINQ?

A deferred execution encapsulates a query’s definition without executing it till the data is used at runtime. However, an immediate implementation calls the query at the same moment as its definition.

var oddNumbers = new[] {1, 3, 5, 7, 9};

var deferredExecution = oddNumbers.Where(x => x > 1);
//will not be executed until this variable is used somewhere

var immediateExecution = oddNumbers.Where(x => x > 1).ToList();
//after adding tolist,result code will be executed and the result set will be kept in memory

Console.WriteLine(deferredExecution);
//Code will be executed for line now

By default, the executions are deferred, but we can do them immediately by calling “ToList ()”. For example, in this way, a list of objects will be executed and returned to us when we define it.

15. What are an object and a class?

An object is an instance of a class, and a class is a template for creating objects.

Class is the definition of an object, the description of its characteristics and operations, its properties, and its methods. An object has an identity because its characteristics have values.

16. What are inheritance, polymorphism, and encapsulation?

Inheritance is the ability to reuse definitions from one class to another and base one class on another.

Polymorphism helps declare the same method within a class with different arguments or return types.

Encapsulation is to be able to expose only the methods, property, and arguments necessary to use the operations of a class. However, the detailed implementation remains private, hidden from other objects.

17. What is an attribute and how are they used?

An attribute is a declarative tag or a powerful method of associating metadata with code. Hence, its primary function is to convey information about program assemblies, classes, methods, structures, etc. to runtime.

They add metadata to a program and you can apply several attributes to program elements like assemblies, modules, etc.

18. What is Metadata?

Metadata is information or data structures about the types defined in a program. It is machine-readable information that may contain basic details like size, format, etc. 

19. What is the difference between an abstract class and an interface?

  • An abstract class can contain both public and private constructors, methods, and fields. On the contrary, the interface contains only methods and public properties.
  • You can only inherit from an abstract class but implement many interfaces.
  • An interface defines behavior, something that the class that implements it can do. Contrary, an abstract class defines what the class is and what it represents.
  • You can’t instantiate anyone.
  • An abstract class is useful when creating components, making a partial initial implementation and a specific definition. This leaves you free to implement other methods.
public interface IEmployee
{
    public string GenerateEmployeeId();

}

public abstract class Employee : IEmployee
{
    private static int _id=1000;
    protected abstract string IdPrefix { set;private get; }

    public virtual string GenerateEmployeeId()
    {
        _id = _id + 1;
        return $"{IdPrefix}{_id}";
    }
}

public class Permanent : Employee
{
    protected override string IdPrefix
    {
        set => value = "EMP";
    }
}

public class FreeLancer : Employee
{
    protected override string IdPrefix
    {
        set => value = "CNT";
    }
}

Senior .NET developer interview questions about this topic take on various formats, to strengthen conceptual understanding. It will help you know the answer irrespective of the framing of the question.

20. What is the Single Responsibility Principle?

Single Responsibility refers to a class performing a specific function or responsibility instead of leaning toward high cohesion.

High cohesion is when one class performs multiple responsibilities.

21. What is God Class?

A God class is a class that controls too many functions or objects in the system. Typically a class is not supposed to control several objects; hence such a class is outside the parameters of logic and becomes ‘the class that controls everything.’

22. What is the difference between public, static, and void?

  • Public declared variables or methods are accessible anywhere in the application.
  • Static declared variables or methods are globally accessible without creating an instance of the class. A static member is by default not globally accessible; it depends upon the type of access modified used. The compiler stores the address of the method as the entry point and uses this information to begin execution before any objects are created.
  • Void is a type modifier that states that the method or variable does not return any value.

23. What is a sealed class?

It is a class that is not inheritable. A sealed class comes into use for a super-specialized class by design and prevents modification by overwriting.

Regular vs Sealed Class
Regular vs Sealed Class

24. What is a “jagged array”?

The Array, which has elements of type array, is called a jagged Array. The elements can be of different dimensions and sizes. We can also call a jagged Array an Array of arrays.

25. What is serialization?

Serialization converts an object to a data stream. However, for this, you must implement ISerialize.

26. What is the difference between constants and read-only variables?

For constants, the compilation contains declaration and initialization. Its value cannot change.

Read-only is only used when we want to assign the value at run time.

27. Explain the difference between Task and Thread in .NET

A ‘Thread’ is a unit of CPU utilization, hence, it is an OS-level instruction and offers extensive control to the programmer. It has a dedicated program and memory area, and you can use it to Abort, Suspend and Resume other threads. Threads are built into the operating system instead of being a .NET construct.

Conversely, ‘Tasks’ are loaded in memory and do not create their OS thread. They are not independent, unlike threads, and need a scheduler for execution. Another key feature of Task is that you can track its finishing time.

28. What is Multithreading?

Multithreading is a process that uses multiple threads, each of which performs unique activities. In this way, one process can perform several types of activities at the same time. You can see the number of threads a single process is running in the Task Manager on your PC.

Following are the ways in which .NET supports multithreading:

  1. Using ThreadPool class with asynchronous methods.
  2.   Starting threads with ThreadStart delegates.

29. Explain the differences between preemptive threads and non-preemptive threads.

A preemptive threading model is flexible and allows the virtual machine to intervene to change control of threads when it sees fit. In contrast, in a non-preemptive threading model, a thread continues to exercise control until it is blocked or explicitly yields control.

30. What is a Let clause?

Let clause is part of a query syntax or query expression that introduces a variable that you can initialize with the result of your preferred expression. This variable can be used at other points in the query to invoke the programmed expressions.

var list = new[] { "A", "B" };
var result = from x in list
    let y = x.ToLowerInvariant()//Variable inside the linq expression
    where y == "a"
    select x + " " + y;

31. Explain Mutex

Threads share a mutually exclusive resource manager, Mutex. It ensures that only one thread at a time makes use of one resource (one object) at a time.

It is like a moderator that controls the microphone and gives the word to one person at a time. Thus, Mutex grants access to resources one thread at a time. For this, it puts the threads that want to access resources “on hold” until those are in use.

namespace DotNetDemo.Console
{
    class Program
    {
        private static void Main(string[] args)
        {
            using Mutex mutex = new Mutex(false, "MutexDemo");
            //Checking if Other External Thread is Running
            if(!mutex.WaitOne(5000, false))
            {
                System.Console.WriteLine("An Instance of the Application is Already Running");
                System.Console.ReadKey();
                return;
            }
            System.Console.WriteLine("Application Is Running.......");
            System.Console.ReadKey();
        }
    }
}

Mutex is a popular topic for senior .NET developer interview questions, especially because of its applications.

32. What is immutability, what is it for, and how is it codified?

The ability of objects not to change their state, once created, helps improve the maintainability of the code. When a mutable object encapsulates its changes without being explicit in the code, following the flow becomes difficult—the level of difficulty increases in the case of multi-threaded applications. To create immutable objects, pass the arguments for their creation in the constructor; make their properties read-only later.

33. What is the difference between Override and Overload in a method?

Override is to overwrite the method with the same signature (parameters and return type) but different functionality. Overwriting requires a “virtual” declaration of the method.

On the other hand, overloading refers to coding several versions of the same method. Though the “virtual” declaration for a method is not necessary to overload, it requires a different signature (parameters and/or return value).

34.What is the difference between structure and class?

A class is a definition of an object and is inheritable. A structure, on the other hand, defines a type of data and is non-inheritable.

35.What is the difference between ODBC and ADO?

Open Database Connectivity is a standard for managing database operations in applications. The standard uses the same methods for Oracle as for Mysql. For example, it declares the connection with particularity at the user or operating system level.

ADO is a set of .Net libraries for data management, including ODBC connections. For ADO, ODBC is a driver.

36.What is an Entity Framework?

Entity Framework is an open-source (Object Relational Mapper) ORM framework by Microsoft. It optimizes mapping between objects, making it easier to work with data using domain-specific class objects.

The lack of need to focus on databases and other storage allows developers to work with more details and aim for more sophisticated executions. 

37.What is the difference between encrypting a password and applying a hashing?

Hashing is a one-way encryption. Meaning, once you hash the value, you cannot convert that back to the plain text. Most of the applications use hashing techniques to store the password in the database.

Because In case if somebody gets access to the database. They can’t see the password because it is not in plain text format.

In the case of encryption, you can encrypt the plain text into the encrypted format. Also, you can decrypt the encrypted text into the plain text if you have required information about the algorithm and keys used for encryption and decryption.

38.What’s the relationship between a code point and a code unit in Unicode?

A code point represents a unit of information, so it is a number that has a corresponding Unicode character. In contrast, a code unit represents a unit of storage of only a part of an encoded code point. Hence, a single code point requires multiple code units for full representation.  

39.What is Reflection, and what is it for?

It is the ability to read, instantiate, and invoke the properties & methods of an assembly’s classes. It is especially useful when we do not have the source code for classes, only their assembly.

40.What is a design pattern, and what is it for? Give some examples

It is a reusable template to solve a common problem at the design level. It is not the code but best practices to codify a solution.

Some examples are Singleton, Abstract Factory, Observer or Pub/Sub, Model View Controller, Model View Presenter, and Model-View View-Model.

41.Why do we use the “using” statement?

We use the “using” statement to make sure that we release the resources of the object in use. It always calls “Dispose of” when it finishes its block of code.

42.What is a variable of implicit type, and what is its scope?

It is a variable that doesn’t require type declaration since the compiler automatically determines its type. Its scope is local, within a method. It only allows inferring the kind the first time it assigns a value to the second. However, if the type is different, it throws an error.

43.What is an anonymous method, and how is it different from a lambda expression?

For an anonymous method, the declaration comes before its use and implementation through a delegate. Also, this method doesn’t require a name.

A lambda expression refers to an anonymous method in a single line, elegantly replacing the representative for this function.

44.Under which situation should one use ‘volatile’ as a keyword?

You can use the keyword ‘volatile’ to describe a field that can be modified my multiple threads that are executing simultaneously. This keywords acts as a green signal for elements like compiler and runtime to rearrange memory locations to reduce the chances of memory malfunction.

45.What is the Native Image Generator?

It is a tool that compiles the .Net assemblies to machine code for a specific processor. In this way, it improves its performance since the JIT no longer intervenes.

46.How many types of assemblies are there?

There are three main types of assemblies in .NET:

  1. Private Assembly
  2. Shared Assembly
  3. Satellite Assembly

Private Assembly – A private assembly launches for a specific application and cannot be used by any other application. Its exclusive use means it is stored in its application’s directory and cannot be accessed by others.

Private assemblies are ideal for developing isolated applications; however, they need to have a versatile design to enable them to work with other assembly types.

Shared Assembly – Shared assemblies, unlike private assemblies, can be used by multiple applications. They are also called public assemblies, and several applications are dependent on them for smooth functioning.

Although shared assemblies aren’t typically registered on the global system, the dependence means they are globally available. It ensures users can access them and use them for dependent applications when required.

Their public availability is convenient; however, rules are needed to maintain control. Each shared assemble must have a unique name, version number, and it must be installed in the Global Assembly Cache (GAC).

Satellite Assembly – Assemblies used to deploy global applications in different languages are called satellite assemblies. They operate by creating separate product IDs for each language, allowing simultaneous (or side-by-side) executions. Satellite assemblies are commonly used for multi-lingual applications, like gaming applications that allow users to run them in the language of their preference.

47.What is MVC?

Model-View-Controller (MVC) is a software design pattern that divides an application into three key components, Model, View, and Controller. The goal of this division is to make the application more manageable, enabling multiple developers to work on it simultaneously.

Each of these components has a set of functions they are responsible for.

Model

The model identifies data-related logic for the application and manages all data changes. It alerts ‘View’ when the state of data changes to initiate change in display. Additionally, the model alerts the controller when the change requires controlling the updated view.

View

The view controls the application display and collaborates with model and controller in case of change requirements.

Controller

The controller is the connective interface between Model and View and leverages its position to process business logic and requests. It corresponds to data change requests from Model and works with View to create the desired output.

48.Is the JIT an interpreter?

No, the JIT is not an interpreter. It is a compiler at runtime that improves performance compiling method by method only once. If the method is called a new account, the native code already compiled is used. However, an interpreter executes the same every block of code.

49.What is State Management in .NET?

State management allows servers to store data to monitor or maintain the state of objects during runtime. The best example is when a user shops online. A typical purchase cycle includes adding items to the cart, checkout, information form filling, and order placement.

A user clicks a link after each step, which would typically wipe out the information they entered previously. However, state management features like cookies, control state, query strings, etc., allow pages to retain the information.

There are two key types of state management:

  1. Client-Based State Management
  2. Server-Side State Management

Client-Based State Management – Client-based state management involves retaining information on the page or storing it on their system. Therefore, the scenario mentioned above is an example of this type of state management.

Server-Side State Management – Server-side state management stores information on the server rather than presenting it in front of the client. This type of state management is ideal for cases when the operator wants to optimize information shared with the client to prevent cluttering.

Application state, session state, and profile properties are the core features of server-side state management.

Although this section is relatively basic, it can be one of the senior .NET developer interview questions you come across.

50.Can a generic action be implemented in WebAPI?

No, you cannot implement a generic action in WebAPI. WebAPI runtime requires clear knowledge of method signatures in advance, making the task impossible.

51.What is caching?

Caching allows applications to temporarily store data at a convenient location, where it is easily accessible. It allows users to access the data easily through temporary memory instead of looking it up in the original storage location.

There are three types of caching:

  • Page Caching – static HTML version of a page that is stored as a backup to be used in case the real-time version is unavailable.
  • Data Caching – Temporary static storage of basic data, like profile information, so it can be presented quickly and efficiently upon request (auto-filling forms).
  • Fragment Caching – Refers to storing a fragment of data on a webpage rather than the entire webpage. For example, caching a graph on a webpage will mean it will load more quickly the next time they open the same URL. 

52.What are the differences between function and a stored procedure in .NET?

There are several differences between a function and a stored procedure . NET.

Stored procedures are a precompiled set of SQL statements used to perform specific tasks. They can have both input and output parameters, and they can be used to manage transactions. Stored procedures also allow DML queries like insert, update, etc.

The function is a database object on the SQL server and has a single return value. They only have an input parameter, and you cannot manage transactions inside them. Functions do not have an output parameter and only allow select queries.

53.What does role-based security mean?

Role-based security is an example of security measures implemented based on employee roles and their respective clearances. Windows system accounts are a good commercial application of this feature, assigning different access levels to users and administrators because both have separate roles.

54.How is manifest used in .NET?

Manifest’s primary function is to store metadata of the assembly, meaning it defines how an application should run. The metadata provides information about security and the assembly’s version requirements to outline the scope. There are four key reasons why you need the metadata stored using manifest:

  • Security Identification
  • Assembly Version Information
  • Scope Checking the Assembly
  • Reference Validation for Classes

55.What do boxing and unboxing mean?

Boxing is used to convert value type into a reference type, while unboxing achieves the opposite. Unboxing coverts reference type into a value type.

56.What is an application domain?

An application domain primarily acts as a container for data and code and is one of the key components of .NET. CLR allows multiple applications to run on the same application domain, with the domain creating logical barriers to prevent applications from interacting with or crashing into each other.

57. How many types of constructors are present in .NET?

There are five different types of constructors present in .NET:

  • Default Constructor – It does not take any parameter, with .NET creating it automatically if the programmer doesn’t define a default constructor inside a class. Since it has no parameters, a default constructor initializes numeric fields to zero and all object fields to null.
  • Parameterized Constructor – A parameterized constructor is consciously developed by the programmer and has at least one defined parameter.
  • Copy Constructor – As the name implies, the copy constructor copies variables from an existing object to create a new one.
  • Private Constructor – A private constructor is relatively isolated in that it cannot be derived from or copied to produce duplicates. It works best when the user only has static members to work with.
  • Static Constructor – Static constructors can only be invoked once in the class. This invocation usually happens at the time of the creation of the class or during the first reference to a static member in the class. It helps minimize static fields, does not take modifier access, or has parameters it needs to follow.

58.What are globalization and localization?

Globalization is the process of developing applications with multi-language support. Netflix, YouTube, and Instagram are only some examples of applications where globalization is applicable.

In contrast, localization is the process of changing a globally established application to support a local language. There are multiple extensions available to help localize an application, so users can deploy them to achieve results.

59.What is Repeater Control?

Repeater control is data-bound control used to display a repeated list of items. For example, a child’s monthly fee records fall under repeater control territory, as it is a recurring event. Generally, this tool may be bound to an XML file, a database (like student records), or a similar list.

Such control is typically unformatted and has no built-in layout, style, tags, etc. Hence, a programmer will need to add details if they want the data to follow a specific format.

60. Which types of templates are present in Repeater control?

Repeater control has multiple templates for organizing data. Following are the most basic templates that it contains:

  • <ItemTemplate> – for elements rendered once for every row of data
  • <AlternatingItemTemplate> – for elements rendered after every other row of data. Can be used for font differences, color differences, background changes, etc.
  • <HeaderTemplate> – to render elements before the <ItemTemplate> section
  • <FooterTemplate> – to render elements after the <ItemTemplate> section
  • <SeperatorTemplate> – to render between each row (line breaks)

61. What is cross-page posting?

Cross-page posting involves taking information collected from one page and posting it on the next one. Online orders are a good example of cross-page posting because some of the steps require the page to use data entered on one page (home address) and post it onto the next (shipping and billing detail confirmation).

POSTBACK property is useful for cross-posting; therefore, it is best for senior developers to know about the process.

62.How do you use MIME in .NET?

Multipurpose Internet Mail Extensions, or MIME, is an extension of the email protocol that allows users to exchange files through the internet. It identifies file type, nature, or format and allows smooth conversion and data transfer.

63.What is passport authentication?

Passport authentication is a centralized authentication service by Microsoft that uses encrypted cookies to achieve intended results. The benefit of passport authentication is that users do not need to enter sensitive sign-in information every time to access their accounts.

After receiving relevant permissions, .NET passport-enabled sites use the encrypted cookies to enable automatic and hassle-free sign-in. In some cases, users are redirected to another page to authenticate themselves, but it mostly takes a couple of clicks to get the job done.

64.What is an HTTP Handler?

HTTP handler is a response to requests made to a .NET web application. There are several kinds of handlers to manage different files, with the ASP.NET page handler being the most commonly used.

Aside from page handlers, User Control, Web Service, and Trace Handler are also examples of some of the most frequently used handlers that help create and control webpages.

65.List some ASP.NET security controls.

The ASP.NET security controls are deployed to provide users with account security. Following are examples of some of the controls they include:

  • Account Login: <asp: Login>

Provides a login capability that enables the users to enter their credentials.

  • Login Name Display: <asp: LoginName>

Allows you to display the name of the logged-in user.

  • Login Status Display: <asp: LoginStatus>

Displays if the user is authenticated or not.

  • Login Template View: <asp: LoginView>

Provides login views based on the selected template

  • Password Recovery: <asp: PasswordRecovery>

Emails the users the lost passwords.

66. Which types of cookies are in ASP.NET?

The purpose of a cookie is to store data and leverage it to optimize the user experience. There are two main types of cookies in .NET:

  1. Session Cookie
  2. Persistent Cookie
  • Session Cookie – Session cookies are temporary data storages that remain for a single login session on the user’s machine. They get deleted once the user logs out.
  • Persistent Cookie – Persistent cookies remain on the user’s machine for an extended period and only get deleted after they reach their expiration period.

I hope this list of the top 28 .NET interview questions and answers helps you get your next job. If you find these c# interview questions for senior developer useful? Feel free to share your feedback and concerns in the comment section below.

Types of cookies in ASP.NET?

  • Session Cookie – Session cookies are temporary data storages that remain for a single login session on the user’s machine. They get deleted once the user logs out.
  • Persistent Cookie – Persistent cookies remain on the user’s machine for an extended period and only get deleted after they reach their expiration period.
  • What is passport authentication?

    Passport authentication is a centralized authentication service by Microsoft that uses encrypted cookies to achieve intended results. The benefit of passport authentication is that users do not need to enter sensitive sign-in information every time to access their accounts.

    What do boxing and unboxing mean?

    Boxing is used to convert value type into a reference type, while unboxing achieves the opposite. Unboxing coverts reference type into a value type.

    Comments are closed.

    Scroll to Top