ASP.NET Developer

50+ ASP.NET Developer Interview Questions and Answers

Updated 12 Dec 2024

Popular Companies

search-icon

Q1. All opps concept. What is constructor?, what is delegets? What is inheritance? What is abtract class.?

Ans.

Explanation of OOP concepts like constructor, delegates, inheritance, and abstract class.

  • Constructor is a special method that is called when an object is created.

  • Delegates are type-safe function pointers used to reference methods.

  • Inheritance is a mechanism that allows a class to inherit properties and methods from another class.

  • Abstract class is a class that cannot be instantiated and is used as a base class for other classes.

Q2. What is the difference between primary and unique key

Ans.

Primary key uniquely identifies each record in a table, while unique key ensures that all values in a column are different.

  • Primary key does not allow NULL values, while unique key allows one NULL value.

  • A table can have only one primary key, but multiple unique keys.

  • Primary key is automatically indexed, while unique key is not.

  • Example: Primary key for a table of students could be student_id, while unique key could be email_id.

Q3. For MVC what is model controller view, What is ActionResults,

Ans.

MVC is a software architecture pattern that separates an application into three main components: Model, View, and Controller. ActionResults are methods that return data to the client.

  • Model: represents the data and business logic of the application

  • View: represents the user interface of the application

  • Controller: handles user input and updates the model and view accordingly

  • ActionResults: methods that return data to the client, such as a view or JSON data

  • Examples of ActionResult...read more

Q4. what is the flow of mvc application

Ans.

MVC application flow involves the request being handled by the controller, which interacts with the model to retrieve data and then passes it to the view for rendering.

  • 1. Request is received by the controller

  • 2. Controller interacts with the model to retrieve data

  • 3. Data is passed to the view for rendering

  • 4. View generates the HTML response to be sent back to the client

Are these interview questions helpful?

Q5. one number is missing from 1 to 100. Find it's value

Ans.

One number is missing from 1 to 100. Find it's value.

  • Use the formula n(n+1)/2 to find the sum of numbers from 1 to 100

  • Subtract the sum of numbers given from the sum of numbers from 1 to 100 to find the missing number

  • The missing number is 5050 minus the sum of given numbers

Q6. What is StateManagement in Asp.Net?

Ans.

StateManagement in ASP.NET refers to the techniques used to preserve data between multiple requests from the same user.

  • StateManagement is important for maintaining the state of controls on a web page across postbacks.

  • There are different ways of managing state in ASP.NET such as ViewState, Session, Cookies, and Application state.

  • ViewState is used to store page-specific information that is preserved across postbacks.

  • Session state is used to store user-specific information that ...read more

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q7. What are the action listens. explain action filter

Ans.

Action filters are used to perform additional processing before or after an action method executes.

  • Action filters are attributes that can be applied to an action method or controller.

  • They can be used to perform authentication, logging, caching, and other tasks.

  • Action filters can be used to modify the result of an action method.

  • There are four types of action filters: Authorization filters, Action filters, Result filters, and Exception filters.

Q8. What is abstraction and interface

Ans.

Abstraction is the concept of hiding complex implementation details and showing only the necessary information. Interface is a contract that defines the methods that a class must implement.

  • Abstraction allows us to focus on what an object does instead of how it does it.

  • Interface defines a set of methods that a class must implement, but it does not provide the implementation details.

  • Abstraction can be achieved through abstract classes and interfaces in object-oriented programmi...read more

ASP.NET Developer Jobs

Asp.Net Developer with Azure 4-7 years
First American
3.7
₹ 7 L/yr - ₹ 17 L/yr
Hyderabad / Secunderabad
Asp.Net Developer 4-8 years
Birlasoft
3.7
Noida
Asp.Net Developer 1-4 years
Lauren Information Technologies
3.8
Ahmedabad

Q9. Sql query to get top 5 records from the table.

Ans.

Use the SELECT TOP statement in SQL to retrieve the top 5 records from a table.

  • Use the SELECT statement to specify the columns you want to retrieve.

  • Use the TOP keyword followed by the number of records you want to retrieve.

  • Specify the table name in the FROM clause.

  • Add any necessary conditions in the WHERE clause.

  • Order the results if needed using the ORDER BY clause.

Q10. What all tools you have used

Ans.

I have used various tools including Visual Studio, Git, JIRA, and SQL Server Management Studio.

  • Visual Studio for coding and debugging

  • Git for version control

  • JIRA for project management

  • SQL Server Management Studio for database management

Q11. 2. Difference between abstraction and encapsulation

Ans.

Abstraction focuses on the outside view of an object while encapsulation deals with the internal workings of an object.

  • Abstraction is the process of hiding complex implementation details and showing only necessary information to the user.

  • Encapsulation is the process of wrapping data and methods into a single unit (class) and restricting access to the data from outside the class.

  • Abstraction is achieved through interfaces and abstract classes.

  • Encapsulation is achieved through a...read more

Q12. In Asp.net where the session data is stored

Ans.

Session data in ASP.NET is stored either in-process, out-of-process, or in a SQL Server database.

  • In-process storage stores session data in memory on the web server.

  • Out-of-process storage stores session data in a separate process, such as State Server or SQL Server.

  • SQL Server database storage stores session data in a SQL Server database.

  • Session data can be configured in web.config file using element.

Q13. delete and truncate difference,roles in your previous project,garbage collector

Ans.

Delete vs Truncate, roles in previous project, garbage collector

  • Delete removes rows one by one, while truncate removes all rows at once

  • Roles in previous project may include developer, tester, project manager, etc.

  • Garbage collector in .NET automatically manages memory by reclaiming unused objects

Q14. Difference b/w Label and Literal control in asp.net c#.

Ans.

Label control is used to display text while Literal control is used to display HTML content.

  • Label control is a lightweight control that displays text on a web page.

  • Literal control is used to display HTML content on a web page.

  • Label control is rendered as a span element while Literal control is rendered as the HTML content it contains.

  • Label control does not allow HTML tags while Literal control allows HTML tags.

  • Label control is faster than Literal control.

Q15. Diff between function and stored procedures

Ans.

Functions return a value while stored procedures do not.

  • Functions can be used in SQL statements while stored procedures cannot.

  • Functions can be called from within stored procedures.

  • Functions can be used in views while stored procedures cannot.

  • Functions can have input parameters while stored procedures can have both input and output parameters.

Q16. Difference between abstract class and interfaces

Ans.

Abstract classes can have implementation while interfaces cannot. Classes can implement multiple interfaces but only inherit from one abstract class.

  • Abstract classes can have constructors while interfaces cannot

  • Interfaces can only have method signatures while abstract classes can have both method signatures and implementation

  • Abstract classes can have access modifiers while interfaces cannot

  • Classes can implement multiple interfaces but only inherit from one abstract class

Q17. What is page life cycle in asp .net

Ans.

Page life cycle in ASP.NET is the sequence of events that occur during the processing of a web page.

  • Page life cycle consists of various stages like initialization, loading, postback, rendering, and unloading.

  • During initialization, the page and controls are created and their properties are set.

  • During loading, the page retrieves and processes the user input.

  • During postback, the page handles the events raised by the user.

  • During rendering, the page generates the HTML markup to be...read more

Q18. Difference between class and object

Ans.

A class is a blueprint or template for creating objects, while an object is an instance of a class.

  • A class defines the properties and methods that an object will have.

  • An object is created from a class using the 'new' keyword.

  • Multiple objects can be created from a single class.

  • Classes can inherit properties and methods from other classes.

  • Objects can have unique values for their properties, while classes define the structure of those properties.

Q19. out 0f all candidates, ehy should we hore you?

Ans.

I have the necessary skills, experience, and passion to excel in this role.

  • I have extensive experience in ASP.NET development.

  • I am a quick learner and can adapt to new technologies easily.

  • I am a team player and can work collaboratively with others.

  • I am passionate about coding and always strive to improve my skills.

  • I have a strong work ethic and am committed to delivering high-quality work.

Q20. Running Projects in Company with Technology

Ans.

Running projects in a company requires selecting the appropriate technology for the project.

  • Consider the project requirements and constraints

  • Evaluate available technologies and their suitability

  • Choose the technology that best fits the project needs

  • Ensure the technology is compatible with existing systems

  • Train team members on the selected technology

Q21. What is web technologies?

Ans.

Web technologies refer to the tools and techniques used to create, manage, and deliver web-based applications and services.

  • Web technologies include programming languages like HTML, CSS, JavaScript, and server-side languages like PHP, ASP.NET, and Java.

  • Web technologies also include frameworks and libraries like React, Angular, and jQuery.

  • Web technologies are used to create websites, web applications, and web services that can be accessed through the internet.

  • Web technologies a...read more

Q22. What is sql and what are the joins

Ans.

SQL is a programming language used for managing and manipulating databases. Joins are used to combine rows from two or more tables based on a related column between them.

  • SQL stands for Structured Query Language and is used to interact with databases.

  • Joins are used to combine data from multiple tables based on a related column.

  • Common types of joins include INNER JOIN, LEFT JOIN, RIGHT JOIN, and FULL JOIN.

  • Example: SELECT * FROM table1 INNER JOIN table2 ON table1.column = table2...read more

Q23. What is ASP.Net ?

Ans.

ASP.NET is a web application framework developed by Microsoft.

  • It allows developers to build dynamic web applications and services.

  • It supports multiple programming languages such as C#, VB.NET, and F#.

  • It provides a rich set of libraries and tools for building web applications.

  • It includes features such as authentication, caching, and session management.

  • It can be used to build web applications for desktop and mobile devices.

Q24. Explain MVC . Model view control

Ans.

MVC is a software architecture pattern that separates an application into three interconnected components: Model, View, and Controller.

  • Model represents the data and business logic of the application

  • View is responsible for rendering the user interface

  • Controller handles user input and updates the model and view accordingly

Q25. Difference between Interfaces and Abstract class

Ans.

Interfaces define only method signatures while abstract classes can have method implementations.

  • Interfaces cannot have method implementations, abstract classes can.

  • A class can implement multiple interfaces but can inherit only one abstract class.

  • Interfaces are used for defining contracts, abstract classes are used for code reusability.

  • Interfaces are more flexible as they allow multiple inheritance through interfaces.

  • Abstract classes can have constructors, interfaces cannot.

Q26. Tell me about runtime polymorphism

Ans.

Runtime polymorphism is the ability of a method to be dynamically bound at runtime based on the type of the object.

  • It allows a subclass to provide its own implementation of a method that is already defined in its parent class.

  • It is achieved through method overriding.

  • The decision of which method to execute is determined by the actual type of the object at runtime.

  • It enables code reusability and flexibility in object-oriented programming.

  • Example: Animal class has a method calle...read more

Q27. different view state in asp.net ?

Ans.

View state is used to persist the state of a web form across postbacks in ASP.NET.

  • View state can be enabled or disabled at the page level or control level.

  • Different types of view state include enabled, disabled, and encrypted.

  • View state can be used to store values of controls on a web form between postbacks.

Q28. Difference between Enum and Constant

Ans.

Enum is a type that represents a set of named constants while constant is a fixed value that does not change.

  • Enum can have multiple named constants with unique values, while constant is a single fixed value.

  • Enums are used when a variable can only have a few possible values, while constants are used for values that do not change.

  • Enums can be used in switch statements, while constants cannot.

  • Example: enum Colors { Red, Green, Blue } vs const int MaxValue = 100;

Q29. Tell me the opps four pillars

Ans.

The four pillars of OOP are encapsulation, inheritance, polymorphism, and abstraction.

  • Encapsulation: Bundling data and methods that operate on the data into a single unit (class).

  • Inheritance: Allowing a class to inherit properties and behavior from another class.

  • Polymorphism: The ability for objects of different classes to respond to the same method call.

  • Abstraction: Hiding the complex implementation details and showing only the necessary features of an object.

Q30. Why we use Sealed class

Ans.

Sealed class is used to prevent inheritance and ensure that the class cannot be extended.

  • Prevents inheritance, ensuring that the class cannot be extended

  • Helps in maintaining code integrity and security

  • Used when a class is not intended to be inherited or overridden

Q31. what are restful api's

Ans.

RESTful APIs are a type of web service that follows the principles of REST (Representational State Transfer) architecture.

  • RESTful APIs use standard HTTP methods like GET, POST, PUT, DELETE to perform CRUD operations on resources.

  • They are stateless, meaning each request from a client to the server must contain all the information necessary to understand the request.

  • RESTful APIs typically return data in JSON or XML format.

  • They are designed to be scalable and easily maintainable...read more

Q32. what are stored procedures

Ans.

Stored procedures are precompiled SQL queries stored in a database for reuse.

  • Stored procedures are used to improve performance by reducing the need to send multiple queries to the database server.

  • They can be parameterized to accept input values and return results.

  • Stored procedures can contain logic and business rules, making them reusable and secure.

  • Examples include procedures for inserting, updating, and deleting data in a database.

Q33. what is dependency injection

Ans.

Dependency injection is a design pattern in which a class receives its dependencies from external sources rather than creating them itself.

  • Allows for better code reusability and testability

  • Promotes loose coupling between classes

  • Commonly used in ASP.NET Core for managing services and components

Frequently asked in,

Q34. Explain MVC models and Action Listeners.

Ans.

MVC models are a design pattern for web applications. Action Listeners are used to handle user input.

  • MVC stands for Model-View-Controller

  • Model represents the data and business logic

  • View is the user interface

  • Controller handles user input and updates the model and view

  • Action Listeners are used in GUI programming to handle user input events

  • For example, a button click can trigger an Action Listener to perform a specific action

Q35. 1. Explain Oops concepts in c#

Ans.

OOPs concepts in C# include inheritance, encapsulation, polymorphism, and abstraction.

  • Inheritance allows a class to inherit properties and methods from another class.

  • Encapsulation is the practice of hiding implementation details and exposing only necessary information.

  • Polymorphism allows objects of different types to be treated as if they are the same type.

  • Abstraction is the process of hiding complex implementation details and providing a simplified interface for the user.

  • Exa...read more

Q36. What is output cache

Ans.

Output cache stores the output of a page or user control so that it can be quickly retrieved for subsequent requests.

  • Output cache is used to improve the performance of web applications.

  • It reduces the number of requests made to the server by storing the output of a page or user control.

  • Output cache can be set at the page level or at the application level.

  • It can be configured to expire after a certain amount of time or when certain conditions are met.

  • Output cache can be used to...read more

Q37. what are the 4 pillars?

Ans.

The 4 pillars of object-oriented programming are encapsulation, inheritance, polymorphism, and abstraction.

  • Encapsulation: Bundling data and methods that operate on the data into a single unit.

  • Inheritance: Allowing a class to inherit properties and behavior from another class.

  • Polymorphism: The ability for objects of different classes to respond to the same message.

  • Abstraction: Hiding the complex implementation details and showing only the necessary features.

Q38. Inheritance work explain

Ans.

Inheritance is a mechanism in OOP where a new class is derived from an existing class.

  • Inheritance allows for code reuse and promotes code organization.

  • The derived class inherits all the properties and methods of the base class.

  • The derived class can also override or extend the functionality of the base class.

  • There are different types of inheritance such as single, multiple, and hierarchical inheritance.

  • Example: A Car class can be derived from a Vehicle class, inheriting its pr...read more

Q39. what is view state?

Ans.

View state is a hidden field on an ASP.NET web page that stores state information.

  • View state is used to persist page and control state across postbacks.

  • It is stored as a hidden field on the page and is encrypted by default.

  • View state can be disabled to improve performance, but it may lead to loss of state information.

Q40. Diffrent between transient vs scope

Ans.

Transient objects are created each time they are requested, while scoped objects are created once per request.

  • Transient objects are created every time they are requested, leading to potentially higher memory usage.

  • Scoped objects are created once per request and are shared within the scope of that request.

  • Example: Transient objects are typically used for lightweight services, while scoped objects are used for services that need to maintain state within a request.

Q41. What's stored procedure

Ans.

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

  • Stored procedures can be called from application code to execute complex logic on the database side.

  • Example: CREATE PROCEDURE GetCustomers AS SELECT * FROM Customers;

Q42. Explain Startup file?

Ans.

Startup file is a configuration file in ASP.NET that specifies settings and behavior for the application.

  • Startup file is typically named 'Startup.cs' in ASP.NET Core projects.

  • It contains configuration for services, middleware, and the request processing pipeline.

  • The 'ConfigureServices' method is used to add services to the dependency injection container.

  • The 'Configure' method is used to configure the HTTP request pipeline.

  • Startup file is responsible for setting up the applica...read more

Q43. What is polymorphism

Ans.

Polymorphism is the ability of an object to take on many forms. It allows objects of different classes to be treated as the same type.

  • Polymorphism is a fundamental concept in object-oriented programming.

  • It allows a single interface to be used for different types of objects.

  • Polymorphism is achieved through method overriding and method overloading.

  • Example: A base class Animal can have derived classes like Dog, Cat, and Bird, all implementing their own unique behavior while stil...read more

Frequently asked in, ,

Q44. What is Asp.Net MVC?

Ans.

ASP.NET MVC is a web application framework developed by Microsoft that implements the model-view-controller pattern.

  • ASP.NET MVC separates the application into three main components: Model, View, and Controller.

  • Model represents the application's data and business logic.

  • View represents the user interface.

  • Controller handles user input and updates the model and view accordingly.

  • ASP.NET MVC provides better control over HTML, CSS, and JavaScript compared to Web Forms.

  • It supports te...read more

Q45. what is oop ?

Ans.

OOP stands for Object-Oriented Programming, a programming paradigm based on the concept of objects.

  • OOP focuses on creating objects that contain both data and methods to manipulate that data.

  • Encapsulation, inheritance, and polymorphism are key principles of OOP.

  • Examples of OOP languages include Java, C++, and C#.

Q46. Explain Api lifetimes

Ans.

API lifetimes refer to the duration for which an API is available and supported.

  • API lifetimes can vary depending on the service provider or platform.

  • Some APIs may have a limited lifetime and be deprecated after a certain period.

  • Developers should be aware of API lifetimes to plan for potential changes or updates.

  • Regularly check for updates or announcements regarding API lifetimes to stay informed.

Q47. Explain solid principle

Ans.

SOLID principles are a set of five design principles that help developers create more maintainable and scalable software.

  • S - Single Responsibility Principle: A class should have only one reason to change.

  • O - Open/Closed Principle: Software entities should be open for extension but closed for modification.

  • L - Liskov Substitution Principle: Objects of a superclass should be replaceable with objects of its subclasses without affecting the program's correctness.

  • I - Interface Segr...read more

Q48. Explain MVC life cycle

Ans.

MVC life cycle is the sequence of events that occur during the processing of a web request in ASP.NET MVC.

  • 1. Routing: Determines which controller and action method to call based on the URL.

  • 2. Controller: Executes the action method and returns a ViewResult or other types of results.

  • 3. View: Renders the HTML output to be sent back to the client.

  • 4. Model Binding: Maps the data from the request to the action method parameters.

  • 5. Action Filters: Allow you to run code before or aft...read more

Q49. Technologies i worked on

Ans.

I have worked on ASP.NET, C#, SQL Server, JavaScript, HTML, CSS

  • ASP.NET

  • C#

  • SQL Server

  • JavaScript

  • HTML

  • CSS

Q50. What's oops explain

Ans.

Object-oriented programming (OOP) is a programming paradigm based on the concept of objects, which can contain data and code.

  • OOP focuses on creating objects that interact with each other to solve problems

  • Encapsulation: bundling data and methods that operate on the data into a single unit (object)

  • Inheritance: allows a class to inherit properties and behavior from another class

  • Polymorphism: the ability for objects to be treated as instances of their parent class or their own cl...read more

1
2
Next
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Interview Questions for ASP.NET Developer Related Skills

Interview experiences of popular companies

3.7
 • 10k Interviews
3.9
 • 7.8k Interviews
3.7
 • 7.3k Interviews
3.8
 • 4.6k Interviews
3.6
 • 3.7k Interviews
3.6
 • 3.6k Interviews
4.1
 • 3 Interviews
View all

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

ASP.NET Developer Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

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

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter