Senior .NET Developer

70+ Senior .NET Developer Interview Questions and Answers

Updated 2 Jul 2025
search-icon
4d ago

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).

Ans.

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

2d ago

Q. what are Microservices? How to manage load balancing in Microservices?

Ans.

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

illustration image

Asked in Infosys

2d ago

Q. what is extension method ,value type and reference type ,migration in codefirst approach,Configure menthod in dotnet core ,

Ans.

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

4d ago

Q. What are the differences between .Net and .Net Core?

Ans.

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

Are these interview questions helpful?
5d ago

Q. What is depandancy injection in. Net core and what toes of depandancy injection with example

Ans.

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

2d ago

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.

Ans.

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

Cognizant logo
Senior .Net Developer 4-9 years
Cognizant
3.7
₹ 5 L/yr - ₹ 20 L/yr
(AmbitionBox estimate)
Hyderabad / Secunderabad
Cognizant logo
Senior .Net Developer 6-11 years
Cognizant
3.7
₹ 6 L/yr - ₹ 15 L/yr
(AmbitionBox estimate)
Hyderabad / Secunderabad
Gallagher Service Center (GSC) logo
Senior .Net Developer(.Net Core+Azure) || Kochi 4-7 years
Gallagher Service Center (GSC)
3.7
Kochi
4d ago

Q. what are Design Patters? What is DI?

Ans.

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

2d ago

Q. How do you use Dependency Injection (DI) in .NET Core?

Ans.

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 🌟

man-with-laptop

Asked in Infosys

4d ago

Q. What are the differences between PUT, PATCH, and POST requests?

Ans.

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

3d ago

Q. What are the different ways to inject services?

Ans.

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

5d ago

Q. What is the return type for controller actions?

Ans.

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

6d ago

Q. Write code to pop a node from a stack data structure.

Ans.

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.

3d ago

Q. What is the difference between a function and a stored procedure in SQL?

Ans.

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

1d ago

Q. What is the difference between a stored procedure and a stored function?

Ans.

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.

3d ago

Q. If a cursor takes up memory, why do we use it?

Ans.

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.

4d ago

Q. What is middleware in .NET Core?

Ans.

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

2d ago

Q. How does JWT authentication work in Web API?

Ans.

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

6d ago

Q. Briefly explain server-side validation in ASP.NET.

Ans.

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

4d ago

Q. What are the .NET components?

Ans.

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

3d ago

Q. What is managed and unmanaged code?

Ans.

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

4d ago

Q. What is the difference between Entity Framework and ADO.Net?

Ans.

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

6d ago

Q. How would you design a database schema for conducting an online test?

Ans.

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

4d ago

Q. How do you add validation in MVC?

Ans.

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

4d ago

Q. How to use transactions in SQL?

Ans.

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

1d ago

Q. What are Middleware and filters?

Ans.

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

3d ago

Q. How can you store two values in the same HTML tag?

Ans.

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

4d ago

Q. How do you implement Dependency Injection (DI) in a controller?

Ans.

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

3d ago

Q. What are the Design patterns?

Ans.

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

1d ago

Q. What is Dependency Injection?

Ans.

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

6d ago

Q. What is the difference between Single and First in LINQ?

Ans.

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

1
2
3
Next

Interview Experiences of Popular Companies

TCS Logo
3.6
 • 11.1k Interviews
Accenture Logo
3.8
 • 8.6k Interviews
Infosys Logo
3.6
 • 7.9k Interviews
Wipro Logo
3.7
 • 6.1k Interviews
Capgemini Logo
3.7
 • 5.1k Interviews
View all

Top Interview Questions for Senior .NET Developer Related Skills

interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

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

Senior .NET Developer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits