.NET Application Developer

20+ .NET Application Developer Interview Questions and Answers

Updated 17 Nov 2024

Q1. If the class is declared as Sealed, can we inherit from it? What do we use it? Can seal class inherit from some other class?

Ans.

Sealed classes cannot be inherited from. They are used to prevent inheritance and ensure class integrity.

  • Sealed classes are declared using the 'sealed' keyword in C#.

  • They are used to prevent other classes from inheriting from them.

  • Sealed classes can inherit from other classes, but they cannot be inherited from.

Q2. Cursors in SQL, Is trigger really required? In what cases can we use it? Syntax of it

Ans.

Cursors in SQL are used to iterate through a result set, triggers are not always required but can be useful for enforcing business rules.

  • Cursors in SQL are used to fetch and process individual rows from a result set.

  • Triggers in SQL are used to automatically perform actions when certain events occur in a database.

  • Triggers can be useful for enforcing data integrity constraints or auditing changes to data.

  • Syntax of a trigger: CREATE TRIGGER trigger_name ON table_name FOR INSERT,...read more

Q3. What is abstract class? What is interface? Difference between both and when do we use them?

Ans.

Abstract class is a class that cannot be instantiated and may contain abstract methods. Interface is a contract that defines methods that a class must implement.

  • Abstract class can have both abstract and non-abstract methods, while interface can only have abstract methods.

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

  • Abstract classes are used when you want to provide a default implementation for some methods, while interfaces are used to def...read more

Q4. What is GC? Can we force GC to run? If yes, how to do it?

Ans.

GC stands for Garbage Collection. It is a process of automatically reclaiming memory occupied by objects that are no longer in use.

  • GC is a part of the .NET runtime that manages memory by automatically freeing up memory occupied by objects that are no longer needed.

  • We can suggest the GC to run by calling the GC.Collect() method, but it is not recommended to force GC as it can have performance implications.

  • Forcing GC to run can be done by calling GC.Collect() method with option...read more

Are these interview questions helpful?

Q5. Follow-up Question:- How do you maintain the code for Dev/QA/Production?

Ans.

Code is maintained using version control systems like Git, with separate branches for Dev, QA, and Production.

  • Use version control systems like Git to track changes and manage code.

  • Create separate branches for Dev, QA, and Production to isolate changes and prevent conflicts.

  • Implement a code review process to ensure quality and consistency across environments.

  • Automate deployment processes to easily promote code changes from one environment to another.

  • Regularly update dependenci...read more

Q6. OOPs concept. How do we implement/use/purpose for Encapsulation, Abstraction?

Ans.

Encapsulation is the concept of bundling data and methods that operate on the data into a single unit. Abstraction is the concept of hiding the implementation details and showing only the necessary features of an object.

  • Encapsulation helps in data hiding and prevents direct access to data from outside the class.

  • Abstraction helps in reducing complexity by hiding unnecessary details and showing only essential features.

  • Encapsulation is achieved by using access modifiers like pri...read more

Share interview questions and help millions of jobseekers 🌟

man-with-laptop

Q7. What is purpose of finally, final, Dispose keyword in C#?

Ans.

finally is used in exception handling, final is a keyword for classes, Dispose is used for releasing unmanaged resources.

  • finally block is used in exception handling to ensure a piece of code is always executed, whether an exception is thrown or not.

  • final keyword is used in C# to prevent inheritance or overriding of a method, class, or property.

  • Dispose method is used to release unmanaged resources like file handles or database connections to prevent memory leaks.

Q8. What is SOLID principle? Name or explain one of them

Ans.

SOLID is a set of five design principles in object-oriented programming. One of them is the Single Responsibility Principle (SRP).

  • SRP states that a class should have only one reason to change, meaning it should only have one job or responsibility.

  • For example, a class that handles both user authentication and database operations violates SRP. It should be split into two separate classes.

  • SRP helps in making code more maintainable, testable, and easier to understand.

.NET Application Developer Jobs

.NET Application Developer 3-6 years
Harjai Computers
3.8
₹ 7 L/yr - ₹ 9 L/yr
Mumbai
.NET Application Developer 4-9 years
Vichara Technologies
4.0
₹ 18 L/yr - ₹ 30 L/yr
Pune
.NET Application Developer 2-4 years
JIT Global Infosystems
0.0
₹ 4 L/yr - ₹ 5 L/yr
Chennai

Q9. What is Routing? Have you heard about Conventional Routing?

Ans.

Routing is the process of directing network traffic to its destination. Conventional Routing is a method of defining routes based on conventions.

  • Routing is the process of determining the path that network packets should take from the source to the destination.

  • Conventional Routing involves defining routes based on conventions or predefined rules.

  • In web development, routing refers to mapping URLs to specific controllers and actions in an application.

  • Conventional Routing in ASP....read more

Q10. How do we do Error handling in .Net application?

Ans.

Error handling in .NET application involves using try-catch blocks to handle exceptions and ensure graceful error recovery.

  • Use try-catch blocks to catch exceptions and handle them appropriately

  • Use specific exception types for different error scenarios

  • Implement logging to track errors and troubleshoot issues

  • Consider using global exception handling for unhandled exceptions

  • Use custom error messages to provide meaningful feedback to users

Q11. How to deploy code in test environment

Ans.

Code deployment in test environment involves creating a deployment package and deploying it to the test server.

  • Create a deployment package containing all necessary files and configurations.

  • Deploy the package to the test server using tools like Octopus Deploy or Azure DevOps.

  • Test the deployed code in the test environment to ensure it functions as expected.

Q12. What is MVC page cycle in detail

Ans.

MVC page cycle is the sequence of events that occur during the lifespan of a MVC page.

  • MVC page is requested by the user

  • Routing engine determines the appropriate controller and action method

  • Controller executes the action method and returns a view

  • View is rendered and sent back to the user's browser

Q13. Session management in ASP .Net & different types

Ans.

Session management in ASP .Net involves storing user-specific data during their visit to a website.

  • ASP .Net provides in-process, state server, and SQL Server session management options

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

  • State server session management stores session data in a separate server process

  • SQL Server session management stores session data in a SQL Server database

  • Session management helps maintain user state across multiple requ...read more

Q14. Difference between Global & Temp table.

Ans.

Global tables are accessible to all sessions, while temp tables are only accessible to the session that created them.

  • Global tables are permanent and stored in the database, while temp tables are temporary and stored in memory or tempdb.

  • Global tables can be accessed by multiple users and sessions, while temp tables are local to the session that created them.

  • Global tables require explicit creation and dropping, while temp tables are automatically dropped when the session ends o...read more

Q15. What is regular expression

Ans.

Regular expression is a sequence of characters that define a search pattern.

  • Regular expressions are used for pattern matching in strings

  • They can be used for tasks like validation, searching, and replacing text

  • Examples: ^[a-zA-Z0-9]+@[a-zA-Z0-9]+\.[a-zA-Z]{2,4}$ is a regex for email validation

Q16. ACID properties in the database

Ans.

ACID properties ensure database transactions are processed reliably.

  • ACID stands for Atomicity, Consistency, Isolation, and Durability.

  • Atomicity ensures that either all operations in a transaction are completed or none are.

  • Consistency ensures that the database remains in a valid state before and after the transaction.

  • Isolation ensures that multiple transactions can occur concurrently without affecting each other.

  • Durability ensures that once a transaction is committed, it will ...read more

Q17. Explain ASP .Net Page Lifecycle

Ans.

ASP .Net Page Lifecycle is a series of events that occur when a page is requested, processed, and rendered by the server.

  • Page Request: Initiated by the user or browser.

  • Page Initialization: Page properties are set.

  • Page Load: Controls on the page are loaded and data is bound.

  • Postback Event Handling: User interactions trigger events.

  • Page Rendering: Page is rendered to HTML and sent to the browser.

  • Page Unload: Cleanup and finalization tasks.

Q18. What is MasterPage?

Ans.

MasterPage is a feature in ASP.NET that allows for creating a consistent layout for multiple pages.

  • MasterPage defines the common structure and interface for all pages in a web application.

  • It allows for the separation of content and layout, making it easier to maintain and update.

  • MasterPage can contain placeholders for content that can be filled in by individual pages.

  • Changes made to the MasterPage will be reflected across all pages that use it.

  • Example: Creating a MasterPage w...read more

Q19. What is Lazy Loading

Ans.

Lazy loading is a design pattern where data is loaded only when it is needed.

  • Lazy loading helps improve performance by loading data on demand

  • It is commonly used in ORM frameworks like Entity Framework

  • Example: Loading related entities only when accessed in a database query

Q20. var keyword in SQL

Ans.

The var keyword is not used in SQL, it is used in C# to declare implicitly typed variables.

  • The var keyword in C# allows you to declare a variable without explicitly specifying the type, the type is inferred by the compiler.

  • In SQL, you must explicitly specify the data type when declaring variables or columns.

  • Example in C#: var number = 10; // Compiler infers that number is an integer

  • Example in SQL: DECLARE @name VARCHAR(50); // Explicitly specifying the data type

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

Interview experiences of popular companies

3.9
 • 8.1k 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

.NET Application 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