.NET Software Developer
20+ .NET Software Developer Interview Questions and Answers
Q1. Can sealed class inherit non-profit sealed class
No, a sealed class cannot inherit a non-sealed class.
A sealed class is a class that cannot be inherited.
A non-sealed class can be inherited by other classes.
Inheritance is not possible from a non-sealed class to a sealed class.
Q2. Can abstract class inherit non-abstract class
No
An abstract class cannot inherit a non-abstract class.
An abstract class can only be inherited by other classes or abstract classes.
A non-abstract class can be inherited by both abstract and non-abstract classes.
.NET Software Developer Interview Questions and Answers for Freshers
Q3. What is .net? What is boxing , unboxing? Wha is constraints ? Explain oops?
.NET is a software framework developed by Microsoft. Boxing and unboxing are operations to convert value types to reference types and vice versa.
Boxing is the process of converting a value type to an object type, which involves creating a new object on the heap and copying the value into it.
Unboxing is the process of extracting the value type from an object type, which involves casting the object to the appropriate value type and copying the value back to the stack.
Constraint...read more
Q4. What is oops. What is .net core What is Mssql. What is joins. What is union. What is procedures
Answers to common technical questions asked in a .NET Software Developer interview.
OOPs stands for Object-Oriented Programming, a programming paradigm that uses objects to represent real-world entities.
.NET Core is a cross-platform, open-source framework for building modern applications.
MS SQL is a relational database management system used to store and retrieve data.
Joins are used to combine data from two or more tables based on a related column.
Union is used to combine the ...read more
Q5. Why abstract class called as abstract class
An abstract class is called so because it cannot be instantiated and can only be used as a base for other classes.
An abstract class is designed to be inherited by other classes.
It provides a common interface and functionality that derived classes can implement or override.
An abstract class can have both abstract and non-abstract methods.
It can also have abstract properties and events.
Example: The System.IO.Stream class in .NET is an abstract class that provides a common inter...read more
Q6. Can sealed class inherit abstract class
No, a sealed class cannot inherit an abstract class.
A sealed class is a class that cannot be inherited.
An abstract class is a class that cannot be instantiated and is meant to be inherited by other classes.
Since a sealed class cannot be inherited, it cannot inherit an abstract class.
Share interview questions and help millions of jobseekers 🌟
Q7. Difference in Webservices and WCF, Abstraction and its types, Boxing and Unboxing
Webservices and WCF are both used for communication between applications. Abstraction is a concept in programming. Boxing and unboxing are operations in .NET.
Webservices and WCF are both used for communication between applications, but WCF provides more advanced features like message queuing and reliable sessions.
Abstraction is a concept in programming that allows us to hide complex implementation details and only expose the necessary functionality.
There are two types of abst...read more
Q8. Create login form and stored value in database
Create a login form and store values in a database.
Create a form with input fields for username and password
Use a server-side language like C# to handle form submission
Hash and salt the password before storing it in the database
Use SQL to insert the username and hashed password into the database
.NET Software Developer Jobs
Q9. What is dependency injection and middleware.
Dependency injection is a design pattern used to remove hard-coded dependencies and make components more modular. Middleware is software that acts as a bridge between an operating system or database and applications, handling requests and responses.
Dependency injection allows for the injection of dependencies into a class or method from an external source, making the code more flexible and testable.
Middleware in .NET can be used to handle cross-cutting concerns such as loggin...read more
Q10. Explain oops and real time example
OOPs is a programming paradigm based on the concept of objects. Real-time example is a car.
OOPs stands for Object-Oriented Programming
It focuses on creating objects that interact with each other to solve a problem
Real-time example: A car is an object that has properties like color, model, and methods like start, stop, accelerate
Q11. What is boxing and unboxing
Boxing is the process of converting a value type to a reference type, while unboxing is the reverse process.
Boxing is done implicitly when a value type is assigned to an object reference.
Unboxing is done explicitly by casting the object reference back to the value type.
Boxing and unboxing can cause performance issues and should be used sparingly.
Q12. how authentication work for web api
Authentication for web API involves verifying the identity of users before granting access to resources.
Authentication can be done using tokens like JWT or OAuth.
API endpoints can be secured using authentication middleware.
User credentials are validated against a data store like a database.
Authentication headers like Authorization are used to send tokens with requests.
Q13. types of join, Storeprocedure , Subquery
Question about types of join, stored procedures, and subqueries.
Types of join include inner join, left join, right join, and full outer join.
Stored procedures are precompiled SQL statements that can be executed with parameters.
Subqueries are queries nested within another query and can be used to retrieve data for comparison or filtering.
Q14. Creating a employee details form in asp. Net
Creating an employee details form in ASP.NET
Use ASP.NET Web Forms or MVC framework to create the form
Include fields for employee name, address, contact information, job title, etc.
Use validation controls to ensure data entered is accurate
Store employee details in a database for future reference
Q15. Explain company policy, and some other things
Company policy is a set of rules and guidelines that employees must follow in the workplace.
Company policy outlines acceptable behavior and expectations for employees.
It covers areas such as dress code, attendance, communication, and use of company resources.
Employees are expected to adhere to company policy to maintain a positive work environment.
Violation of company policy can result in disciplinary action, up to and including termination.
Q16. What is routing and api.
Routing is the process of directing incoming requests to the appropriate controller and action in an MVC application. APIs are endpoints that allow communication between different software applications.
Routing in .NET helps map URLs to specific controller actions in an MVC application.
APIs in .NET are used to expose functionalities and data to be consumed by other software applications.
Routing and APIs are essential components for building web applications in .NET.
Q17. Explain SQL? What is database?
SQL is a programming language used to manage and manipulate relational databases.
SQL stands for Structured Query Language
It is used to create, modify, and query databases
Common SQL commands include SELECT, INSERT, UPDATE, and DELETE
SQL is used in many popular database management systems such as MySQL, Oracle, and Microsoft SQL Server
Q18. Creating a function in. Net with crud
A function in .NET with CRUD operations.
Create a class with methods for each CRUD operation
Use ADO.NET or Entity Framework for database access
Handle exceptions and validate input
Example: public class Customer { Create(), Read(), Update(), Delete() }
Example: using (var context = new DbContext()) { context.Customers.Add(customer); context.SaveChanges(); }
Q19. how to configure DI services
DI services can be configured in .NET by registering services in ConfigureServices method of Startup class
Register services using AddTransient, AddScoped, or AddSingleton methods
Use IServiceCollection interface to add services
Example: services.AddTransient<IMyService, MyService>()
Q20. Caching and its types
Caching is a technique to store frequently accessed data in a temporary storage to improve performance.
Caching improves application performance by reducing the need to fetch data from the original source.
Types of caching include in-memory caching, database caching, and distributed caching.
In-memory caching stores data in the application's memory for quick access.
Database caching stores frequently accessed data in a separate cache database.
Distributed caching distributes the c...read more
Q21. What are oops concepts
OOPs concepts are fundamental principles of object-oriented programming that help in organizing and designing code.
Encapsulation: Bundling data and methods that operate on the data into a single unit (class).
Inheritance: Ability of a class to inherit properties and behavior from another class.
Polymorphism: Ability to present the same interface for different data types.
Abstraction: Hiding the complex implementation details and showing only the necessary features of an object.
Q22. Write queries and joins
The candidate is asked to write queries and joins.
Understand the requirements and constraints of the query
Identify the tables and columns needed for the query
Write the query using appropriate syntax and functions
Use joins to combine data from multiple tables
Test the query to ensure it returns the expected results
Q23. What is store procedure
Stored procedure is a precompiled SQL query that is stored in the database for reuse.
Stored procedures improve performance by reducing network traffic and increasing security.
They can accept parameters and return results like a regular SQL query.
Stored procedures can be called from application code to execute complex logic on the database server.
Examples: sp_GetCustomerById, sp_InsertOrder
Q24. Types of joins. Stored procedure
Types of joins in SQL are inner join, left join, right join, and full outer join. Stored procedures are precompiled SQL queries stored in the database for reuse.
Inner join: Returns rows when there is at least one match in both tables.
Left join: Returns all rows from the left table and the matched rows from the right table.
Right join: Returns all rows from the right table and the matched rows from the left table.
Full outer join: Returns rows when there is a match in one of the...read more
Q25. how to handle CORS
CORS can be handled by configuring the server to allow cross-origin requests from specified origins.
Configure server to include appropriate CORS headers like Access-Control-Allow-Origin
Use middleware or filters to handle CORS in .NET applications
Consider security implications when allowing cross-origin requests
Q26. What is C# and .net
C# is a programming language developed by Microsoft for building applications on the .NET framework.
C# is a modern, object-oriented language with similarities to Java.
.NET is a software framework developed by Microsoft for building and running applications.
C# and .NET are commonly used for developing web applications, desktop applications, and mobile apps.
C# code is compiled into Intermediate Language (IL) which runs on the Common Language Runtime (CLR) in the .NET framework.
Q27. Middleware in .Net core
Middleware in .NET Core is a component that can handle requests and responses in the application pipeline.
Middleware is a piece of software that can intercept and process HTTP requests and responses.
Middleware components are added to the application pipeline in the Startup class.
Middleware can perform tasks such as authentication, logging, error handling, etc.
Example: UseMiddleware<CustomMiddleware>()
Q28. What is Distinct
Distinct is a keyword in SQL used to retrieve unique values from a column.
Distinct eliminates duplicate rows from the result set
It is commonly used in SELECT queries
Example: SELECT DISTINCT column_name FROM table_name
Q29. Action filters in mvc?
Action filters in MVC are attributes that can be applied to controller actions to perform logic before or after the action is executed.
Action filters can be used to perform tasks like logging, authentication, authorization, caching, etc.
Examples of action filters include AuthorizeAttribute, OutputCacheAttribute, HandleErrorAttribute, etc.
Interview Questions of Similar Designations
Interview experiences of popular companies
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/Month