DOT NET Developer

600+ DOT NET Developer Interview Questions and Answers

Updated 4 Jul 2025
search-icon
1w ago

Q. write a program to print ***** (n=5) and next line 4*, then 3*... I did all theoretical questions well, but didnt complete this program, and in 5 minutes, he took the laptop and asked be to go back.

Ans.

Program to print decreasing number of asterisks in each line

  • Create a loop to iterate from n to 1

  • In each iteration, print the corresponding number of asterisks

  • Use a nested loop to print the asterisks in each line

3d ago

Q. How do you create automated jobs in an application?

Ans.

Automated jobs can be created using scheduling tools or by writing custom code to run at specific intervals.

  • Use scheduling tools like Windows Task Scheduler or Cron to run jobs at specific intervals

  • Write custom code using libraries like Quartz.NET or Hangfire to schedule and run jobs

  • Jobs can perform tasks like data backups, sending emails, or running reports

Asked in Infosys

1w ago

Q. Write a LINQ query to fetch data from the 'students' database table, ordering the data by 'studentID' in ascending order.

Ans.

Use LINQ to fetch data from the 'students' table in ascending order of 'studentid'.

  • Use LINQ query syntax or method syntax to retrieve data from the 'students' table.

  • Order the data by 'studentid' in ascending order using the 'OrderBy' or 'OrderByDescending' method.

  • Ensure that the LINQ query is executed against the database to fetch the data.

1w ago

Q. What are the SQL queries to delete and update records based on specific conditions?

Ans.

SQL queries for deleting and updating records based on specific conditions

  • For deleting records based on specific conditions: DELETE FROM table_name WHERE condition;

  • For updating records based on specific conditions: UPDATE table_name SET column1 = value1, column2 = value2 WHERE condition;

Are these interview questions helpful?

Asked in TCS

3d ago

Q. What is the SQL query to find the second highest salary from the employee table? What is the difference between the primary key and unique key?

Ans.

To find the second highest salary, use SQL queries with subqueries or the DISTINCT keyword for unique values.

  • Using Subquery: SELECT MAX(salary) FROM employee WHERE salary < (SELECT MAX(salary) FROM employee);

  • Using DISTINCT: SELECT DISTINCT salary FROM employee ORDER BY salary DESC LIMIT 1 OFFSET 1;

  • Handles Ties: Both methods consider ties, ensuring the second highest unique salary is returned.

  • Performance: The choice of method may affect performance based on the size of the emp...read more

1w ago

Q. How do you find the names of employees with the second highest salary in an Employee table?

Ans.

Use SQL query to find the second highest salary employee names in Employee table.

  • Use ORDER BY clause to sort the salaries in descending order.

  • Use LIMIT 1 OFFSET 1 to get the second highest salary.

  • Join the Employee table with itself to get the employee names corresponding to the second highest salary.

DOT NET Developer Jobs

UST GLOBAL TECHNOLOGY SERVICES logo
.NET Developer (C#, .NET, MVC, JavaScript) 5-7 years
UST GLOBAL TECHNOLOGY SERVICES
3.8
₹ 8 L/yr - ₹ 14 L/yr
(AmbitionBox estimate)
Mumbai
Genpact logo
Dot Net Developer 3-8 years
Genpact
3.8
Bangalore / Bengaluru
Infosys logo
Dot Net Developer - Chennai 5-10 years
Infosys
3.6
Pune

Q. How would you simplify mathematical expressions like (a+b)^2?

Ans.

The expression (a+b)² can be simplified using the binomial theorem to a² + 2ab + b².

  • Use the formula (x+y)² = x² + 2xy + y².

  • For (a+b)², set x = a and y = b.

  • Result: (a+b)² = a² + 2ab + b².

  • Example: If a=2 and b=3, then (2+3)² = 25, which equals 2² + 2*2*3 + 3².

Asked in Infosys

2w ago

Q. what is application pool,what is IIS,how to host app in dev env,abstarction vs encapsulation,how to optimize databse to improve performance,where to start check is application crashses

Ans.

Application pool is a group of one or more worker processes, IIS is a web server, hosting app in dev env involves setting up IIS, abstraction focuses on hiding implementation details, encapsulation bundles data and methods together, optimizing database involves indexing and query optimization, check for application crashes in event logs or monitoring tools.

  • Application pool is a group of one or more worker processes that share the same configuration and application boundaries....read more

Share interview questions and help millions of jobseekers 🌟

man-with-laptop
5d ago

Q. What is MVC? What is MVC page Life Cycle?

Ans.

MVC stands for Model-View-Controller. It is a software architectural pattern for implementing user interfaces.

  • MVC separates the application into three main components: Model (data), View (UI), and Controller (logic)

  • MVC page life cycle involves the following stages: Routing, Controller Initialization, Action Execution, Result Execution, and Rendering

Asked in Yovant

2w ago

Q. What is the difference between VB.Net and MVC?

Ans.

VB.Net is a programming language while MVC is a design pattern for organizing code in web applications.

  • VB.Net is a programming language used for developing applications, while MVC is a design pattern used for organizing code in web applications.

  • VB.Net is a part of the .NET framework, whereas MVC is a design pattern that separates an application into three main components: Model, View, and Controller.

  • VB.Net can be used with or without the MVC pattern, depending on the project ...read more

Asked in TCS

6d ago

Q. Where do we store the configuration in the application?

Ans.

Configuration settings can be stored in various places such as appsettings.json, environment variables, database, or Azure Key Vault.

  • appsettings.json file in ASP.NET Core projects

  • Environment variables for sensitive data

  • Database for dynamic configuration

  • Azure Key Vault for secure storage

Asked in Synechron

2w ago

Q. Using NGRX state management, how do you manage state in your current project?

Ans.

I use Ngrx for state management in my current project by defining actions, reducers, effects, and selectors.

  • Define actions to describe user events or interactions

  • Create reducers to specify how state should change in response to actions

  • Implement effects to manage side effects like API calls

  • Use selectors to retrieve specific pieces of state for components

Asked in FIS

2d ago

Q. What is inheritance and Examples in inheritance.

Ans.

Inheritance is a mechanism in object-oriented programming where a class is based on another class.

  • Inheritance allows a subclass to inherit properties and methods from a superclass.

  • The subclass can also add its own properties and methods.

  • Examples include a Car class inheriting from a Vehicle class, or a Dog class inheriting from an Animal class.

Asked in EPAM Systems

2w ago

Q. Can you write a program that takes the input "aabbccaaa" and produces the output "2a2b2c3a"?

Ans.

Yes, a program can be written to convert 'aabbccaaa' to '2a2b2c3a'.

  • Create a function that iterates through the input string and counts the consecutive characters.

  • Store the count and character in a new string as needed.

  • Return the final output string.

Asked in Sensiple

5d ago

Q. What are design patterns in Dot net, How to handle multiple request at same time?

Ans.

Design patterns in Dot net are reusable solutions to common problems in software design. To handle multiple requests at the same time, we can use asynchronous programming and multithreading.

  • Design patterns in Dot net include Singleton, Factory, Observer, and more.

  • To handle multiple requests at the same time, we can use asynchronous programming with async/await keywords.

  • Another approach is to use multithreading to process multiple requests concurrently.

  • Using Task Parallel Libr...read more

Asked in Infosys

2w ago

Q. What are the characteristics of the singleton pattern and how do you use it?

Ans.

Singleton pattern ensures a class has only one instance and provides a global point of access to it.

  • Characteristics include private constructor, static instance variable, static method to access instance, lazy initialization, and thread safety.

  • Example: public class Singleton { private static Singleton instance; private Singleton() {} public static Singleton getInstance() { if (instance == null) { instance = new Singleton(); } return instance; }}

Asked in Infosys

1w ago

Q. What is the function of an object?

Ans.

The function of an object is to store data and behavior related to a specific entity in a program.

  • Objects store data in the form of properties

  • Objects can have methods which define behavior

  • Objects can be used to model real-world entities like cars, employees, etc.

  • Objects can be instantiated from classes or created dynamically

2w ago

Q. Can a table have multiple primary keys?

Ans.

Yes, a table can have multiple primary keys.

  • A table can have a composite primary key, which consists of multiple columns.

  • Each column in the composite primary key contributes to uniquely identifying each row.

  • Example: CREATE TABLE Employee (emp_id INT, dept_id INT, PRIMARY KEY (emp_id, dept_id));

Asked in NeoSOFT

1w ago

Q. What is the difference between Unique and Primary Key constraints? What is the difference between Clustered and Non-Clustered Indices?

Ans.

Unique, Primary Key, Clustered, and Non-Clustered Indices are all used in database management to enforce data integrity and improve query performance.

  • Unique constraint ensures that all values in a column are unique, but allows NULL values.

  • Primary Key constraint ensures that all values in a column are unique and not NULL. Each table can have only one Primary Key.

  • Clustered Index physically reorders the way records in the table are stored. Each table can have only one Clustered ...read more

2w ago

Q. Examples of Server side session Management? Types of Session State?

Ans.

Server side session management involves storing user data on the server to maintain state. Types include in-process, out-of-process, and database.

  • In-process session state: Data stored in memory on the same server as the application.

  • Out-of-process session state: Data stored in a separate server or service, such as a state server or Redis cache.

  • Database session state: Data stored in a database, such as SQL Server or MySQL.

  • Examples: ASP.NET session state, PHP session management,...read more

2d ago

Q. Can a class simultaneously inherit from an interface and an abstract class, and if so, what is the correct order for this inheritance?

Ans.

Yes, a class can inherit from both an interface and an abstract class, with the correct order being abstract class first, then interface.

  • A class can inherit from one abstract class and multiple interfaces in C#.

  • The syntax for inheritance is: 'class ClassName : AbstractClass, IInterface'.

  • Example: 'class MyClass : MyAbstractClass, IMyInterface'.

  • Abstract classes can provide default implementations, while interfaces define contracts.

  • C# allows multiple interface inheritance but on...read more

3d ago

Q. Rownumber and partition by in sql or how to find duplicate in table .

Ans.

ROW_NUMBER() and PARTITION BY are used in SQL to assign a unique row number to each row within a partition.

  • Use ROW_NUMBER() function along with PARTITION BY clause to assign a unique row number to each row within a partition.

  • To find duplicates in a table, you can use a combination of ROW_NUMBER() and PARTITION BY to identify rows with row numbers greater than 1.

  • Example: SELECT * FROM (SELECT *, ROW_NUMBER() OVER(PARTITION BY column_name ORDER BY column_name) AS row_num FROM t...read more

Asked in MPRDC

1w ago

Q. What is the difference between .NET Framework and .NET Core Framework?

Ans.

The .NET Framework is a Windows-only framework, while .NET Core is cross-platform and open-source.

  • The .NET Framework is a Windows-only framework, while .NET Core is cross-platform and open-source.

  • .NET Framework is a mature framework with a large number of libraries, while .NET Core is a lightweight framework with fewer libraries.

  • .NET Framework requires Windows to run, while .NET Core can run on Windows, Linux, and macOS.

  • The .NET Framework is not open-source, while .NET Core i...read more

2w ago

Q. What is the difference between UNION and UNION ALL in SQL?

Ans.

Union combines and removes duplicates, Union All combines all rows including duplicates.

  • Union merges the results of two or more SELECT statements into a single result set.

  • Union All returns all rows from all SELECT statements, including duplicates.

  • Union requires the same number of columns in all SELECT statements, while Union All does not.

  • Union sorts the result set and removes duplicates, while Union All does not.

  • Union is slower than Union All because it performs additional pr...read more

1w ago

Q. How can you set authorization and authentication in Web API?

Ans.

Authorization and authentication in web API can be set using various methods like JWT, OAuth, and Identity Framework.

  • Use JWT (JSON Web Tokens) for token-based authentication

  • Implement OAuth for secure authorization and authentication

  • Utilize Identity Framework for managing user authentication and authorization

  • Set up roles and policies to control access to resources

Asked in Planetcast

2w ago

Q. What is the difference between IEnumerable and IQueryable?

Ans.

IEnumerable is used for in-memory collection operations, while IQueryable is used for database query operations.

  • IEnumerable is used for querying data from in-memory collections like arrays, lists, etc.

  • IQueryable is used for querying data from a database using LINQ to SQL or Entity Framework.

  • IEnumerable executes the query in-memory, while IQueryable executes the query on the database server.

  • IEnumerable is suitable for LINQ to Objects, while IQueryable is suitable for LINQ to E...read more

Q. If we truncate a table, will the new row start from 1 or continue from the previous value?

Ans.

The new row will start from 1 after truncating a table.

  • Truncating a table removes all rows from the table, resetting the row count to 1.

  • The next row inserted after truncation will have an ID of 1.

  • Truncating a table does not reset the auto-increment value of the primary key column.

Asked in CGI Group

2w ago

Q. Type of data,garbage collector etc What kind of project have you done before

Ans.

I have worked on various projects including web applications, desktop applications, and mobile applications.

  • Developed a web application using ASP.NET MVC and Entity Framework

  • Created a desktop application using WPF and MVVM pattern

  • Built a mobile application using Xamarin.Forms

  • Used garbage collector to manage memory in all projects

  • Handled different types of data such as text, images, and videos

6d ago

Q. What is the difference between IEnumerable, IQueryable, and List in .NET? When would you use each one?

Ans.

IEnumerable, IQueryable, and List are collections in .NET with different use cases and performance characteristics.

  • IEnumerable: Represents a forward-only cursor for iterating over a collection. Example: IEnumerable<int> numbers = new List<int> { 1, 2, 3 };

  • IQueryable: Designed for querying data from a data source, allowing for LINQ queries to be translated to SQL. Example: IQueryable<Customer> customers = dbContext.Customers;

  • List: A concrete collection that provides methods fo...read more

Asked in Sensiple

2w ago

Q. What are filters , Routing and caching in MVC? , How to achieve Authorization in API?

Ans.

Filters, routing, and caching are important concepts in MVC. Authorization in API can be achieved using authentication mechanisms.

  • Filters in MVC are used to perform logic before or after an action method is executed.

  • Routing in MVC is used to map URLs to controller actions.

  • Caching in MVC is used to store data temporarily to improve performance.

  • Authorization in API can be achieved using authentication mechanisms like JWT tokens or OAuth.

  • Example: Using [Authorize] attribute in A...read more

Previous
1
2
3
4
5
6
7
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
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

DOT 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