Question library

.NET interview questions and answers

45 .NET interview questions with answers: 10 junior, 15 mid-level and 20 senior. Junior answers are free to read.

Junior Mid Senior Updated How these answers are created

* View counts were reset on 18 October 2026, when Interviewplus moved to interviewplus.app. Votes were not affected.

Answer

.NET is a software framework developed by Microsoft that is used for developing and running applications on Windows-based operating systems. It is designed to support multiple programming languages such as C#, Visual Basic, and F#.

Some key features of .NET include:

  • Interoperability: .NET enables developers to create applications that can interact with other software components, regardless of the programming language or platform they were created in.
  • Common Language Runtime (CLR): The CLR is the foundation of .NET and provides a managed environment for executing code. It also includes features such as automatic memory management, exception handling, and security.
  • Base Class Library (BCL): The BCL is a collection of reusable classes and types that provide a wide range of functionality for developing applications.
  • Language-Integrated Query (LINQ): LINQ is a set of extensions to the .NET Framework that allows developers to write queries for data sources such as SQL databases, XML documents, and collections.
  • Asynchronous programming: .NET provides support for asynchronous programming, which allows developers to write applications that can perform multiple tasks simultaneously.
  • Cross-platform support: With the release of .NET Core, .NET is now cross-platform and can be used to develop applications that run on Windows, Linux, and macOS.

Overall, .NET provides developers with a powerful and flexible platform for building a wide range of applications.

Answer

In object-oriented programming (OOP), inheritance is the mechanism by which one class can inherit properties and behaviors from another class. The class that inherits from another class is called the derived class, and the class that is inherited from is called the base class.

Inheritance is important for several reasons:

  • Reusability: Inheritance allows developers to reuse code from existing classes, rather than having to write the same code from scratch in every new class. This can save time and improve code quality by reducing the risk of errors.
  • Maintainability: Inheritance can also make code easier to maintain, since changes made to a base class will automatically propagate to all derived classes that inherit from it.
  • Polymorphism: Inheritance enables polymorphism, which allows objects of a derived class to be treated as objects of the base class. This can be useful for writing code that is more general and flexible, and that can be easily extended in the future.
  • Code organization: Inheritance can help to organize code by grouping related classes together in a hierarchy. This can make it easier to understand the relationships between classes, and to navigate and modify the codebase.

Overall, inheritance is a powerful tool in OOP that can make code more efficient, flexible, and maintainable.

Answer

In object-oriented programming, both abstract classes and interfaces provide a way to define abstract types, which cannot be instantiated directly but instead must be implemented by concrete classes. However, there are some key differences between the two:

  • Method implementation: An abstract class can have both abstract and non-abstract methods, while an interface can only have abstract methods (methods without implementation). Abstract classes can provide a default implementation for some or all of their methods, whereas interfaces cannot.
  • Multiple inheritance: A class can implement multiple interfaces, but can only inherit from one abstract class. This is because Java (and some other languages) do not support multiple inheritance of classes.
  • Instantiation: An abstract class cannot be instantiated directly, while an interface cannot be instantiated at all.
  • Purpose: An abstract class is designed to be a base class for other classes to inherit from, while an interface is designed to define a contract that other classes must adhere to.

In general, if you need to define a set of methods that must be implemented by several classes, or if you want to provide a common interface for unrelated classes, use an interface. On the other hand, if you want to provide a common base class with some default behavior that can be extended by subclasses, use an abstract class.

Answer

Both while and for loops are used to repeatedly execute a block of code. The main difference is that the for loop is used when you know the number of times you want to iterate through the loop, while the while loop is used when you don't know the exact number of iterations.

The for loop in .NET has the following syntax:

for (initialization; condition; iteration)
{
    // code to be executed
}

The initialization statement initializes the loop counter, the condition statement is evaluated before each iteration to determine whether the loop should continue, and the iteration statement is executed at the end of each iteration.

Here's an example of a for loop that prints the numbers 1 through 5:

for (int i = 1; i <= 5; i++)
{
    Console.WriteLine(i);
}

The while loop in .NET has the following syntax:

while (condition)
{
    // code to be executed
}

The condition statement is evaluated at the beginning of each iteration to determine whether the loop should continue.

Here's an example of a while loop that prints the numbers 1 through 5:

int i = 1;
while (i <= 5)
{
    Console.WriteLine(i);
    i++;
}

In summary, the for loop is used when you know the exact number of iterations you want to perform, while the while loop is used when you don't.

Answer

In .NET applications, errors and exceptions are handled using structured exception handling with try-catch-finally blocks. A try block contains the code that may throw an exception, and a catch block is used to catch and handle the exception. The finally block is optional and is used to clean up resources after the try block has executed, regardless of whether an exception was thrown.

Here is an example of how to handle an exception in .NET using a try-catch-finally block:

try
{
    // Code that may throw an exception
    int result = DivideNumbers(10, 0);
}
catch (DivideByZeroException ex)
{
    // Handle the exception
    Console.WriteLine("Error: " + ex.Message);
}
finally
{
    // Clean up resources, if any
    Console.WriteLine("End of try-catch-finally block.");
}

In this example, the 'DivideNumbers' function is called with the parameters 10 and 0, which would result in a 'DivideByZeroException' being thrown. The catch block catches the exception and outputs an error message to the console. The finally block is used to output a message indicating the end of the try-catch-finally block.

Here is an example of the 'DivideNumbers' function:

public static int DivideNumbers(int numerator, int denominator)
{
    int result = numerator / denominator;
    return result;
}

In this function, an exception would be thrown if the 'denominator' parameter is 0. The try-catch-finally block in the previous example would catch this exception and output an error message.

Note that there are many different types of exceptions that can be thrown in .NET, and each one may need to be handled differently depending on the specific situation. In general, it's a good practice to catch only the exceptions that you know how to handle, and to let all other exceptions bubble up the call stack to a higher-level handler or the application's default error handling mechanism.

Answer

In computer science, both the stack and the heap are areas of memory used for storing data during program execution, but they differ in several ways.

The stack is a region of memory that is used for storing temporary data, including function parameters, local variables, and the return address of a function. It is a Last-In-First-Out (LIFO) data structure, which means that the most recently added item is the first one to be removed. The stack is typically small, and its size is fixed at compile-time.

On the other hand, the heap is a region of memory used for dynamic memory allocation. It is an area of memory where the programmer can request a block of memory of a specific size and use it as needed. Unlike the stack, the heap is not organized in any specific order, and memory can be allocated and freed in any order. The heap is larger than the stack, and its size can change during program execution.

In summary, the key differences between the stack and the heap are:

  • Usage: The stack is used for storing temporary data during the execution of a function, while the heap is used for dynamic memory allocation.
  • Data structure: The stack is a LIFO data structure, while the heap is an unordered region of memory.
  • Size: The stack is typically smaller and fixed in size, while the heap is larger and can change in size during program execution.
  • Allocation and deallocation: Memory on the stack is automatically allocated and deallocated by the program, while memory on the heap is allocated and deallocated manually by the programmer.

Answer

In C#, interfaces define a contract that a class or a struct must implement, but they do not contain any implementation code. As such, access modifiers such as 'public', 'private', 'protected', and 'internal' do not apply to the items defined in an interface.

The purpose of an interface is to define a set of methods, properties, events, or indexers that a class or a struct must implement in order to comply with the interface contract. All members of an interface are implicitly public, and any class or struct that implements an interface must provide an implementation for all its members.

If access modifiers were allowed in interfaces, they would add unnecessary complexity to the interface contract, and potentially restrict the visibility of the members in the implementing class or struct. For example, if a member of an interface was declared as 'private', it would not be visible outside the implementing class or struct, which would make it impossible to use the interface in a polymorphic way.

By convention, the members of an interface are typically named using PascalCase, and they do not include access modifiers or other keywords that are used to define implementation details. This helps keep the interface contract simple, clear, and easy to understand for developers who are implementing the interface.

Answer

Sure, here's an example program in C# that sorts an array of integers in ascending order using the QuickSort algorithm:

using System;


class Program {
    
    static void Main(string[] args) {
        
        // Initialize an array of integers
        int[] arr = { 5, 2, 8, 4, 7, 1, 3, 6 };

        
        // Call the QuickSort method to sort the array
        QuickSort(arr, 0, arr.Length - 1);

        
        // Output the sorted array
        Console.WriteLine("The sorted array is:");
        
        foreach (int num in arr) {
            Console.Write(num + 
            Console.Write(num + " ");
        }
    }


    static void QuickSort(int[] arr, int left, int right) {
        
        if (left < right) {
            
            // Partition the array and get the index of the pivot element
            int pivotIndex = Partition(arr, left, right);

            
            // Recursively sort the left and right sub-arrays
            QuickSort(arr, left, pivotIndex - 1);
            QuickSort(arr, pivotIndex + 
            QuickSort(arr, pivotIndex + 1, right);
        }
    }


    static int Partition(int[] arr, int left, int right) {
        
        // Select the pivot element (in this case, the last element in the array)
        int pivot = arr[right];

        
        // Initialize the index of the smaller element
        int i = left - 1;

        
        // Loop through the array, swapping elements as needed to partition the array around the pivot
        for (int j = left; j <= right - 1; j++) {
            
            if (arr[j] < pivot) {
                i++;
                
                i++;
                int temp = arr[i];
                arr[i] = arr[j];
                arr[j] = temp;
            }
        }


        // Swap the pivot element with the element at the index of the smaller element
        int temp2 = arr[i + 1];
        arr[i + 
        arr[i + 1] = arr[right];
        arr[right] = temp2;

        
        arr[right] = temp2;
        // Return the index of the pivot element
        return i + 1;
    }
}

The program initializes an array of integers, and then calls the QuickSort method to sort the array in ascending order using the QuickSort algorithm. The QuickSort method recursively partitions the array around a pivot element, and then sorts the left and right sub-arrays using the same method. The Partition method selects the pivot element, and then swaps elements as needed to partition the array around the pivot. Finally, the program outputs the sorted array.

Answer

In C#, both constants and read-only variables are used to declare values that cannot be changed at runtime. However, there are some differences between them that are worth noting.

A constant is a value that is known at compile-time and cannot be changed afterwards. Constants are declared using the 'const' keyword and must be assigned a value at the time of declaration. Constants are implicitly static and can only be declared in the context of a class or a struct. Here's an example:

public class MyClass
{
    public const int MyConstant = 42;
}

A read-only variable is a value that can be assigned at runtime, but cannot be changed afterwards. Read-only variables are declared using the 'readonly' keyword and can be assigned a value either at the time of declaration or in the constructor of the containing class or struct. Here's an example:

public class MyClass
{
    public readonly int MyReadOnlyVariable;

    public MyClass()
    {
        MyReadOnlyVariable = 42;
    }
}

The key difference between constants and read-only variables is that constants are evaluated at compile-time, whereas read-only variables are evaluated at runtime. This means that constants can only be assigned a value that can be determined at compile-time, such as a literal value or the result of a compile-time expression. Read-only variables, on the other hand, can be assigned a value that depends on runtime factors, such as the current system time or the state of an object.

Another difference between constants and read-only variables is that constants are treated as values, whereas read-only variables are treated as variables. This means that constants are substituted with their values at compile-time, whereas read-only variables are evaluated at runtime.

Overall, both constants and read-only variables provide a way to declare values that cannot be changed at runtime, but they have different use cases and limitations. Constants are best suited for values that are known at compile-time, whereas read-only variables are best suited for values that can be assigned at runtime, but cannot be changed afterwards.

Answer

The Common Language Runtime (CLR) is a core component of the .NET framework that is responsible for managing the execution of .NET programs. It provides a number of services, such as memory management, type safety, exception handling, garbage collection, and thread management.

The CLR acts as a bridge between the source code of a program and the low-level instructions sent to the processor. It is responsible for ensuring that the program is written in a language that the processor can understand. It also provides a number of features that make developing applications much easier, such as the ability to use multiple languages in the same program.

For example, the CLR allows developers to write code in languages like C# and Visual Basic, which are then compiled into an intermediate language called Common Intermediate Language (CIL). The CLR then converts this CIL code into native code that can be run on the processor. This makes it easy to write code in multiple languages, as the CLR can handle the compiling and execution of all the languages.

To summarise, the Common Language Runtime is a core component of the .NET framework that is responsible for managing the execution and execution of .NET programs. It provides a number of services, such as memory management, type safety, exception handling, garbage collection, and thread management. It also allows developers to write code in multiple languages and compiles them into a common intermediate language which is then converted into native code that can be run on the processor.

Answer preview

There are several benefits of using .NET Core over .NET Framework: Cross-platform support: .NET Core is designed to be cross-platform and can run on Windows, Linux, and macOS, whereas .NET Framework is limited to running on Windows. Open-source: .NET Core is open-source, which means that developers can access and…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Sure, here's an example C# method that determines whether a given string is a palindrome or not: The IsPalindrome method takes a string input, and returns true if the string is a palindrome (i.e. reads the same backwards as forwards), and false otherwise. The method first converts the string to lowercase and removes…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Caching is an important technique in .NET that can significantly improve the performance of web applications. There are several ways to implement caching in .NET, depending on the specific needs of your application. Here are some common techniques: In-Memory Caching: In-memory caching is the simplest and most commonly…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Role-based security is a common approach to controlling access to resources in .NET applications. It involves defining roles that correspond to specific groups of users, and then granting permissions to those roles. Users are assigned to one or more roles, and their access to resources is determined by the permissions…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Both IQueryable and IEnumerable are interfaces in .NET that are used to represent collections of data. However, there are some important differences between the two interfaces. IEnumerable is the simpler of the two interfaces, and is used to represent a collection of objects that can be enumerated. The IEnumerable…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Sure, here's an example C# program that finds the maximum and minimum values in a given array of integers: The program initializes an array of integers, and then calls the FindMaxAndMin method to find the maximum and minimum values in the array. The FindMaxAndMin method initializes variables to hold the maximum and…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Advantages of using asynchronous programming in .NET: Improved performance: Asynchronous programming allows multiple tasks to be executed concurrently, which can lead to improved performance and responsiveness of the application. This is especially beneficial for applications that perform I/O-bound operations, such as…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

The manifest in the .NET framework is a metadata file that contains information about an assembly, which is the fundamental unit of deployment in .NET. The manifest serves several purposes, including: Assembly identification: The manifest contains details such as the assembly's name, version number, culture, and…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Authentication and authorization are critical aspects of securing .NET applications, and there are several ways to implement them. Here are some common approaches: ASP.NET Identity: ASP.NET Identity is a built-in authentication and authorization system in ASP.NET that provides a flexible and extensible way to…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

An assembly in .NET is a self-contained unit of deployment and versioning that contains compiled code and metadata. It is the building block of .NET applications and consists of several parts: Manifest: The manifest is a metadata component of an assembly that contains information about the assembly such as its…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Dependency Injection (DI) is a design pattern used in software development, including in the .NET framework, that promotes loose coupling and separation of concerns between components of an application. It allows components to be developed independently and tested in isolation, making the codebase more maintainable…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Managed code and unmanaged code are two different types of code that are used in software development. Managed code is code that is executed by the Common Language Runtime (CLR), which is a part of the .NET Framework. The CLR provides a runtime environment that manages the execution of code, including memory…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Ensuring security in .NET applications is an important part of software development, and there are several steps that can be taken to achieve this: Use secure coding practices: Developers should follow secure coding practices when writing .NET applications. This includes using strong authentication and authorization…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Serialization and deserialization are concepts used in .NET to convert objects into a format that can be easily transmitted across different systems or stored in a persistent storage medium. Serialization is the process of converting an object into a binary or textual format that can be transmitted over a network or…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Sure, here's an example C# function that returns the factorial of a given number: The Factorial function takes an integer input and returns the factorial of the input as a long. The function first handles the special cases for 0 and 1, which have factorials of 1. For larger values of num, the function computes the…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Sure, I can explain how the .NET Framework handles garbage collection and some ways you can optimize it for your applications. The .NET Framework provides automatic memory management through its garbage collector (GC), which is responsible for freeing up memory that is no longer needed by an application. The GC runs…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Sure, here's an example C# program that generates the Fibonacci sequence up to a specified number of terms: The program prompts the user to enter the number of terms to generate in the Fibonacci sequence, and then calls the GenerateFibonacciSequence method to generate the sequence. The GenerateFibonacciSequence method…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

The SOLID principles are a set of guidelines for writing maintainable and extensible code. Dependency Injection (DI) is a design pattern that helps achieve several of the SOLID principles. Here's how each of the SOLID principles relates to DI: Single Responsibility Principle (SRP): The SRP states that a class should…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Thread safety refers to the ability of a code or system to perform correctly and consistently when multiple threads are executing concurrently. Writing thread-safe code is essential to avoid data corruption, race conditions, deadlocks, and other issues that can arise when multiple threads access shared resources…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Caching is a technique that allows frequently accessed data to be stored in a fast-access memory or storage, making it faster to retrieve in subsequent requests. Implementing caching at the application level can significantly improve performance by reducing the number of requests made to external services or…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Distributed transactions allow multiple database systems to participate in a single transaction, ensuring that either all updates are committed or none are committed. Implementing distributed transactions in .NET applications can be challenging, but there are several approaches that can be used to achieve this. Here…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

The Task Parallel Library (TPL) is a set of classes in the .NET Framework that enables developers to easily write multithreaded code that can take advantage of multiple processors and cores to improve performance. Here are the steps to use the TPL to improve performance in .NET applications: Identify CPU-bound…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Lazy loading is a design pattern that delays the loading of a resource or object until it is actually needed. It is often used to improve performance and reduce memory usage in applications that deal with large amounts of data. Here's an example of how lazy loading can be implemented in C#: In this example, we have an…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Message queuing is a popular technique used to enable asynchronous communication between applications, allowing messages to be sent and processed independently of each other. In .NET applications, message queuing can be implemented using Microsoft Message Queuing (MSMQ) or RabbitMQ. Here's an overview of how to…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Yes, I can explain how to use the ASP.NET Core framework to build cross-platform web applications. ASP.NET Core is an open-source web framework for building modern web applications. It runs on multiple platforms, including Windows, macOS, and Linux, and supports cross-platform development using the .NET Core runtime…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

There are several ways to deploy a .NET application, but here are some common approaches: Self-contained deployment (SCD): This approach is useful when you want to deploy the .NET runtime with your application. In SCD, you create a self-contained package that includes both your application and the runtime. You can…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Sure, here's an example C# function that removes duplicates from a given list of strings: The RemoveDuplicates function takes a list of strings as input, and returns a new list with duplicates removed. The function uses a HashSet to store unique strings, and loops through the input list, adding each string to the…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

In .NET, a delegate is a type that represents a reference to a method with a specific signature. Delegates are used to implement callbacks, events, and other scenarios where it is necessary to pass a method as an argument to another method. The purpose of a delegate is to provide a way to decouple the caller and the…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Sure, here's an example C# program that calculates the average of a list of integers: The program creates a list of integers, calls the CalculateAverage method to calculate the average, and outputs the result. The CalculateAverage method takes a list of integers as input, and uses the LINQ Average method to calculate…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

The IDisposable interface in .NET is used to provide a mechanism for releasing unmanaged resources such as file handles, database connections, network sockets, and other system resources that are not automatically managed by the .NET garbage collector. The purpose of the IDisposable interface is to ensure that…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Sure, here's an example C# method that checks if a given string is a valid email address: The IsValidEmail method takes a string as input, and returns a boolean indicating whether the string is a valid email address. The method uses a regular expression to match the email address format. The regular expression…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

The Global Assembly Cache (GAC) is a central repository of shared .NET assemblies that are available to all applications on a computer. The purpose of the GAC is to provide a way to share and manage commonly used .NET components across multiple applications, and to ensure that those components are available to all…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

In .NET, regular expressions are implemented using the System.Text.RegularExpressions namespace. The Regex class in this namespace provides a set of methods and properties that can be used to work with regular expressions in .NET applications. Here is an example code snippet that demonstrates how to use regular…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

In .NET, multi-threading can be used to improve the performance and responsiveness of applications by allowing multiple threads of execution to run simultaneously. Here are the basic steps for using multi-threading in a .NET application: Create a new thread: To create a new thread, you can either use the Thread class…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

Answer preview

Sure, here's an example C# program that sorts an array of strings in alphabetical order: The program creates an array of strings, calls the 'SortStrings' method to sort the strings in alphabetical order, and outputs the result. The 'SortStrings' method takes an array of strings as input, and uses the 'Array.Sort'…

Sign in to view this answer

Mid and senior level answers are included in every paid plan. Sign in to choose a plan, or browse the junior level answers for free.

More practice

Go further with .NET

.NET code challenges

10 challenges with answers

Behavioral Questions

10 questions with answers

Cultural Fit Questions

10 questions with answers

Competency-Based Questions

10 questions with answers

Motivational Questions

10 questions with answers

Communication Skills Questions

10 questions with answers

Scenario-Based Questions

10 questions with answers

Problem-Solving and Analytical Questions

10 questions with answers

Ethical and Integrity Questions

10 questions with answers

Industry-Specific Questions

10 questions with answers

Leadership and Management Questions

10 questions with answers

Personal Questions

10 questions with answers

About this topic

.NET interview questions and answers

This page lists 45 .NET interview questions with answers, ordered from junior to senior level. Commonly asked questions include "What is .NET and what are some of its key features?", "Explain what inheritance is, and why it's important" and "What is the difference between an abstract class and an interface?".

Other frequently asked questions include "How do you handle errors and exceptions in .NET applications?", "Explain the difference between the Stack and the Heap." and "What are the benefits of using .NET Core over .NET Framework?". Review each answer and consider how you would adapt it to your own experience.

Practise .NET in a mock interview

Answer questions one at a time and receive a score with written feedback on each answer.

Start a mock interview

Reviews and comments