Senior .NET Developer
70+ Senior .NET Developer Interview Questions and Answers

Asked in Persistent Systems

Q. Given an array of integers, find the indices of two numbers that add up to a specific target value (e.g., 8 or a dynamic value).
Find indexes of two values in an array whose sum is 8 or a dynamic value
Iterate through the array and store the indexes of each element in a dictionary with the difference between the target sum and the element as the key
Check if the current element exists in the dictionary, if so, return the indexes of the two elements
Handle cases where the target sum is dynamic by replacing 8 with a variable

Asked in Persistent Systems

Q. what are Microservices? How to manage load balancing in Microservices?
Microservices are a software architecture design where applications are broken down into smaller, independent services that communicate with each other through APIs.
Microservices are designed to be small, focused, and independently deployable services.
Each microservice typically performs a single function or task within the application.
Microservices communicate with each other through APIs, often using lightweight protocols like HTTP or messaging queues.
Load balancing in micr...read more
Senior .NET Developer Interview Questions and Answers for Freshers

Asked in Infosys

Q. what is extension method ,value type and reference type ,migration in codefirst approach,Configure menthod in dotnet core ,
Extension methods allow adding new methods to existing types, value types store data directly, reference types store references to data, migration in code-first approach involves updating database schema, Configure method in .NET Core configures services and middleware.
Extension methods are static methods that can be called as if they were instance methods on an existing type.
Value types store data directly on the stack, while reference types store references to data on the h...read more

Asked in Infogain

Q. What are the differences between .Net and .Net Core?
The main difference is that .NET Core is open-source and cross-platform while .NET Framework is Windows-only.
Both are used for building Windows applications, but .NET Core can also be used for web and cloud applications.
.NET Core has a smaller runtime and can be deployed as a single executable file.
.NET Core supports Docker containers and can be used on Linux and macOS.
.NET Framework has a larger runtime and requires installation on the target machine.
Some libraries and APIs ...read more

Asked in Clover Infotech

Q. What is depandancy injection in. Net core and what toes of depandancy injection with example
Dependency injection in .NET Core is a design pattern where a class receives its dependencies from external sources rather than creating them itself.
Dependency injection helps in achieving loose coupling between classes.
Types of dependency injection in .NET Core include constructor injection, property injection, and method injection.
Example: Constructor injection involves injecting dependencies through a class's constructor.
Example: Property injection involves injecting depen...read more

Asked in Accenture

Q. Write a function that takes an array of numbers and a target number as input, and returns the indices of two numbers in the array that add up to the target number.
Find pairs in an array that sum up to a specified target number.
Use a hash set to track numbers we've seen.
For each number, check if (target - number) exists in the set.
Example: For array [1, 2, 3, 4] and target 5, pairs are (1, 4) and (2, 3).
Return unique pairs to avoid duplicates.
Senior .NET Developer Jobs




Asked in Persistent Systems

Q. what are Design Patters? What is DI?
Design patterns are reusable solutions to common problems in software design. DI stands for Dependency Injection, a design pattern used to inject dependencies into a class.
Design patterns are best practices for solving common software design problems.
DI is a design pattern where dependencies are injected into a class rather than created within the class.
Examples of design patterns include Singleton, Factory, and Observer.
Dependency Injection helps improve code maintainability...read more

Asked in Wipro

Q. How do you use Dependency Injection (DI) in .NET Core?
DI in .Net Core allows for loosely coupled and testable code.
Add services to the DI container in Startup.cs
Inject dependencies into classes using constructor injection
Use built-in DI or third-party libraries like Autofac
Configure lifetime of services with AddScoped, AddTransient, or AddSingleton
Share interview questions and help millions of jobseekers 🌟

Asked in Infosys

Q. What are the differences between PUT, PATCH, and POST requests?
PUT is used to update or replace an existing resource, PATCH is used to partially update a resource, and POST is used to create a new resource.
PUT is idempotent, meaning multiple identical requests will have the same effect as a single request.
PATCH is not necessarily idempotent and is used to make partial updates to a resource.
POST is used to create a new resource on the server.

Asked in Synechron

Q. What are the different ways to inject services?
Different ways to inject services in .NET
Constructor Injection: Services are injected through a class constructor
Property Injection: Services are injected through public properties
Method Injection: Services are injected as method parameters
Service Locator Pattern: Services are accessed through a central registry
DI Containers: Frameworks like Autofac, Unity, or Ninject manage service injection

Asked in Globant

Q. What is the return type for controller actions?
The return type for controller actions in .NET is typically ActionResult.
The return type for controller actions can be ActionResult, ViewResult, PartialViewResult, JsonResult, ContentResult, RedirectResult, RedirectToRouteResult, FileResult, HttpNotFoundResult, HttpStatusCodeResult, etc.
ActionResult is a base class for all action results in ASP.NET MVC.
Example: public ActionResult Index() { return View(); }

Asked in Barclays

Q. Write code to pop a node from a stack data structure.
Code to pop a node from a stack data structure in C#.
Create a method to remove and return the top element from the stack.
Check if the stack is empty before popping the node to avoid errors.
Decrement the top index after popping the node to update the stack.

Asked in Bank of America

Q. What is the difference between a function and a stored procedure in SQL?
Functions return a single value while stored procedures can perform multiple operations and return multiple values.
Functions return a single value while stored procedures can return multiple values.
Functions are used for computations and return values, while stored procedures are used for executing a sequence of statements.
Functions can be called from within SQL statements, while stored procedures are called using the EXECUTE statement.
Functions cannot modify the database sta...read more

Asked in Danaher

Q. What is the difference between a stored procedure and a stored function?
Stored procedures are used to perform a set of actions, while stored functions return a single value.
Stored procedures can perform multiple actions and can return multiple result sets.
Stored functions are used to return a single value and cannot perform DML operations.
Stored functions can be used in SELECT statements, while stored procedures cannot be used in SELECT statements.

Asked in Clover Infotech

Q. If a cursor takes up memory, why do we use it?
Cursors are used in databases to retrieve and manipulate data, despite consuming memory.
Cursors are used to iterate over a result set in a database query.
They allow for sequential processing of query results.
While they do consume memory, they are necessary for certain operations like updating rows in a specific order.
Cursors should be used judiciously to avoid excessive memory consumption.

Asked in Clover Infotech

Q. What is middleware in .NET Core?
Middleware in .NET Core is software components that are assembled into an application pipeline to handle requests and responses.
Middleware components are executed in the order they are added to the pipeline.
Middleware can perform tasks like authentication, logging, error handling, etc.
Examples of middleware in .NET Core include UseAuthentication, UseMvc, UseStaticFiles.

Asked in Synechron

Q. How does JWT authentication work in Web API?
JWT authentication in Web API involves generating a token with user credentials and validating it on subsequent requests.
JWT stands for JSON Web Token, which is a compact and self-contained way for securely transmitting information between parties as a JSON object.
In Web API, a JWT token is generated upon successful authentication and is sent to the client.
The client includes the JWT token in the Authorization header of subsequent requests to access protected resources.
The We...read more

Asked in Biyani Technologies

Q. Briefly explain server-side validation in ASP.NET.
Server-side validation in ASP.NET ensures data integrity and security by validating user inputs on the server before processing.
Validates user input after it is submitted to the server, ensuring data is correct and secure.
Commonly used to check for required fields, data types, and format (e.g., email validation).
Example: Using the 'Required' attribute in model classes to enforce mandatory fields.
Helps prevent malicious data from being processed, enhancing application security...read more

Asked in Deloitte

Q. What are the .NET components?
Dot net components are reusable software building blocks that provide functionality for various aspects of application development.
Common Language Runtime (CLR) - provides a runtime environment for executing .NET applications
Framework Class Library (FCL) - a collection of reusable classes, interfaces, and value types
ASP.NET - a web application framework for building dynamic web sites, web applications, and web services
ADO.NET - a set of classes that expose data access service...read more

Asked in UnitedHealth

Q. What is managed and unmanaged code?
Managed code is code that is executed by the Common Language Runtime (CLR) while unmanaged code is executed directly by the operating system.
Managed code is written in languages like C#, VB.NET, and F# that are compiled into Intermediate Language (IL) and executed by the CLR.
Unmanaged code is written in languages like C and C++ that directly interact with the operating system and hardware.
Managed code provides automatic memory management, exception handling, and security feat...read more

Asked in Bank of America

Q. What is the difference between Entity Framework and ADO.Net?
Entity Framework is an ORM that simplifies data access in .NET applications, while ADO.Net is a low-level data access technology.
Entity Framework is an Object-Relational Mapping (ORM) framework that allows developers to work with databases using .NET objects.
ADO.Net is a set of classes that allows developers to interact with data sources like databases directly using SQL commands.
Entity Framework provides higher level of abstraction and reduces the amount of code needed for d...read more

Asked in Questionpro

Q. How would you design a database schema for conducting an online test?
DB schema for online test
Create tables for questions, answers, users, and results
Use foreign keys to link tables together
Include fields for question type, difficulty level, and time limit
Store user responses and calculate scores
Consider security measures to prevent cheating

Asked in Wipro

Q. How do you add validation in MVC?
Validation in MVC
Use data annotations for server-side validation
Use jQuery validation for client-side validation
Customize validation messages using ErrorMessage property
Use ModelState.IsValid to check if validation passed
Use ModelState.AddModelError to add validation errors

Asked in Wipro

Q. How to use transactions in SQL?
Transactions in SQL ensure data consistency and integrity during multiple operations.
Transactions group multiple SQL statements into a single unit of work.
They ensure that all statements are executed or none are executed.
They provide data consistency and integrity during multiple operations.
Transactions can be started with BEGIN TRANSACTION and committed with COMMIT or rolled back with ROLLBACK.
They are useful in situations where multiple operations need to be performed atomi...read more

Asked in VVDN Technologies

Q. What are Middleware and filters?
Middleware and filters are components in ASP.NET Core that allow you to handle requests and responses in the pipeline.
Middleware are components that are added to the request pipeline to handle requests and responses.
Filters are used to implement cross-cutting concerns like logging, exception handling, and authorization.
Middleware can be used to modify the request or response before it reaches the controller action.
Filters can be applied globally, at the controller level, or a...read more

Asked in Nibav Lifts

Q. How can you store two values in the same HTML tag?
Use data attributes to store multiple values in the same HTML tag
Use data attributes like data-value1 and data-value2 to store two values in the same HTML tag
Access the values using JavaScript by querying the data attributes

Asked in Wipro

Q. How do you implement Dependency Injection (DI) in a controller?
To call DI in controller, inject the required service in the constructor of the controller.
Add required service in ConfigureServices method of Startup.cs
Inject the service in the constructor of the controller
Use the service in the controller methods
Asked in EnoviQ Technologies

Q. What are the Design patterns?
Design patterns are reusable solutions to common software development problems.
Design patterns provide proven solutions to recurring problems in software development.
They help in creating code that is more flexible, reusable, and maintainable.
Some common design patterns include Singleton, Factory, Observer, and Decorator.
Design patterns can be categorized into three types: Creational, Structural, and Behavioral.

Asked in Infosys

Q. What is Dependency Injection?
Dependency Injection is a design pattern that allows objects to receive dependencies rather than creating them internally.
DI is a way to achieve loose coupling between objects
It helps in creating more testable and maintainable code
DI can be implemented using constructor injection, property injection, or method injection
Example: Instead of creating a database connection object inside a class, we can inject it from outside
Example: ASP.NET Core uses DI to inject services into co...read more

Asked in Hexaware Technologies

Q. What is the difference between Single and First in LINQ?
Single returns the only element of a sequence, or a default value if the sequence is empty. First returns the first element of a sequence, or a default value if the sequence contains no elements.
Single throws an exception if the sequence contains more than one element, while First does not.
Single is useful when you expect only one element in the sequence, while First is used when you just need the first element.
Example: var singleElement = list.Single(); var firstElement = li...read more
Interview Questions of Similar Designations
Interview Experiences of Popular Companies





Top Interview Questions for Senior .NET Developer Related Skills

Calculate your in-hand salary
Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary


Reviews
Interviews
Salaries
Users

